about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2026-06-06 21:42:13 -0400
committerZach DeCook <zachdecook@librem.one>2026-06-06 21:42:13 -0400
commit66d09daccf5fac0caa4bd5b143135a1355543312 (patch)
tree9ce8ea06adc7088b0acf9c789a36c02f2844b824
parent735d1f265e7788a02bff03b008943bb4ce15e025 (diff)
downloadusfm2gmi-master.tar.gz
handle wh HEAD master
-rwxr-xr-xusfm2gmi.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/usfm2gmi.py b/usfm2gmi.py
index 32c5644..b7e993d 100755
--- a/usfm2gmi.py
+++ b/usfm2gmi.py
@@ -35,7 +35,7 @@ def superscript(word):
 def convert(line, printStrongs=False):
   """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* ').replace('\\+w*', '\\+w* ').replace('\\ref*', '\\ref* ').split()
+  split = line.replace('\\', ' \\').replace('\\nd*','\\nd* ').replace('\\+nd*','\\+nd* ').replace('\\f*','\\f* ').replace('\\wj*','\\wj* ').replace('\\w*',' \\w* ').replace('\\+w*', '\\+w* ').replace('\\ref*', '\\ref* ').replace('\\+w', ' \\+w').replace('\\+wa*', '\\+wa* ').replace('\\+wg*', '\\+wg* ').replace('\\+wh*', '\\+wh* ').split()
   out = ''
   nd = False
   superS = False
@@ -80,6 +80,12 @@ def convert(line, printStrongs=False):
       continue
     elif word in ['\\r']:
       out += '\n> '
+    elif word in ['\\+wa', '\\+wa*', '\\wa', '\\wa*']: # https://docs.usfm.bible/usfm/3.1/char/features/wa.html
+      continue
+    elif word in ['\\+wg', '\\+wg*', '\\wg', '\\wg*']: # https://docs.usfm.bible/usfm/3.1/char/features/wg.html
+      continue
+    elif word in ['\\+wh', '\\+wh*', '\\wh', '\\wh*']: # https://docs.usfm.bible/usfm/3.1/char/features/wh.html
+      continue
     elif word in ['\\wj','\\wj*']:
       continue
     elif word in ['\\em','\\it']: