twl-generator 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twl-generator",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Generate term-to-article lists from unfoldingWord en_tw archive for Bible books. Works in both Node.js (CLI) and React.js (browser) environments.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Main module for twl-generator
2
2
  import { generateTWTerms } from './utils/zipProcessor.js';
3
- import { processUsfmForBook, parseUsfmToVerses } from './utils/usfm-alignment-remover.js';
3
+ import { processUsfmForBook, parseUsfmToVerses, removeAllTagsExceptChapterVerse } from './utils/usfm-alignment-remover.js';
4
4
  import { generateTWLMatches } from './utils/twl-matcher.js';
5
5
 
6
6
  export { generateTWTerms, processUsfmForBook };
@@ -17,8 +17,9 @@ export async function generateTWLWithUsfm(book, usfmContent = null) {
17
17
 
18
18
  let verses;
19
19
  if (usfmContent) {
20
- // Parse provided USFM content
21
- verses = parseUsfmToVerses(usfmContent);
20
+ // Parse provided USFM content (clean it first)
21
+ const cleanUsfm = removeAllTagsExceptChapterVerse(usfmContent);
22
+ verses = parseUsfmToVerses(cleanUsfm);
22
23
  } else {
23
24
  // Fetch USFM from git.door43.org
24
25
  if (!book) throw new Error('Book parameter required when no USFM content provided');