about summary refs log tree commit diff
path: root/usfm2gmi.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-03-31 09:03:19 -0400
committerZach DeCook <zachdecook@librem.one>2021-03-31 09:03:19 -0400
commitfd4f94371b9786b53a8add449c9fb674fdc91f13 (patch)
treef1737bb9881ed3420f52ccb4e2631cde6136f016 /usfm2gmi.py
parent8e9a836f62f1395ea4e49d08e27bbc89e29c8579 (diff)
downloadusfm2gmi-fd4f94371b9786b53a8add449c9fb674fdc91f13.tar.gz
Punctuation: Make more spacing more natural
Diffstat (limited to 'usfm2gmi.py')
-rwxr-xr-xusfm2gmi.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/usfm2gmi.py b/usfm2gmi.py
index 43a8c87..d47546a 100755
--- a/usfm2gmi.py
+++ b/usfm2gmi.py
@@ -98,7 +98,15 @@ def convert(line):
       continue
     elif '|strong="' in word:
       spl = word.split('|')
-      out += spl[0] + superscript(spl[1][8:-1]) + ' '
+      out += spl[0] + ' ' #superscript(spl[1][8:-1]) + ' '
+    # Remove those extra spaces that sneak in.
+    elif word in [',', '.', ';', '”', ',”', ')']:
+      if out[-1] == ' ':
+        out = out[:-1] + word + ' '
+      else:
+        out += word + ' '
+    elif word in ['“', '(']:
+      out += word
     else:
      if nd:
       out += smallcaps(word) + ' '