Convert usfm bibles into gemtext (python library/utility)
Punctuation: Make more spacing more natural
Zach DeCook 2021-03-31
parent 8e9a836 · commit fd4f943
-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) + ' '