about summary refs log tree commit diff
path: root/usfm2gmi.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-07-08 21:28:34 -0400
committerZach DeCook <zachdecook@librem.one>2021-07-08 21:28:34 -0400
commit4b03a402048dd02b8da1a0d811c126904d11f0bf (patch)
treea29ff57b50c23bcd341d0faa5d944f16a6e03572 /usfm2gmi.py
parenta3e7f46093c6ef9b72ca00249e41f542d06de6ce (diff)
downloadusfm2gmi-4b03a402048dd02b8da1a0d811c126904d11f0bf.tar.gz
Wordlist Entry: handle more tags
Diffstat (limited to 'usfm2gmi.py')
-rwxr-xr-xusfm2gmi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/usfm2gmi.py b/usfm2gmi.py
index ffdf65e..7bfef3b 100755
--- a/usfm2gmi.py
+++ b/usfm2gmi.py
@@ -35,7 +35,7 @@ def superscript(word):
 def convert(line):
   """Convert a string to a list of tuples, each a token"""
   # TODO: preserve the lack of whitespace before a backslash.
-  split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*','\\w* ').split()
+  split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*','\\w* ').replace('\\+w*', '\\+w* ').split()
   out = ''
   nd = False
   if len(split) == 0:
@@ -94,7 +94,8 @@ def convert(line):
     # TODO: support Endnotes (\fe and \fe*)
     elif word in ['\\ft']:
       continue # TODO: fancy formatting of more types
-    elif word in ['\\w','\\w*']:
+    # Words which appear in the glossary.
+    elif word in ['\\w','\\w*', '\\+w', '\\+w*']:
       continue
     elif '|strong="' in word:
       spl = word.split('|')