Commits

Luke Plant committed 16de2bf

Added support for plain text rendering of WHNU module

Comments (0)

Files changed (1)

lukeplant_me_uk/bibleverses/sword.py

         text = re.sub(r'<lb[^>]*?type="x-end-paragraph"[^>]*?/>', '\n', text)
         text = re.sub(r'<divineName>(.*?)</divineName>', lambda m: m.groups()[0].upper(), text)
         text = re.sub(r'<[^>]*>', '', text) # all other tags
+    elif sourcetype == "ThML":
+        if mod.Name() == "WHNU":
+            # Doesn't seem to have any markup
+            pass
+        else:
+            raise Exception("Don't know how to render ThML modules (except WHNU).")
     else:
         raise Exception("Don't know how to render '%s' modules" % sourcetype)
     return text.decode("UTF-8")