about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2020-12-03 21:02:46 -0500
committerZach DeCook <zachdecook@librem.one>2020-12-03 21:02:46 -0500
commit514e82b5c4c2dbced26d6e230bdc11a3aff523d0 (patch)
treebeff1ca75c0c0724051deaeaae2e84def4f1b828
parent340ab81f36d0fad44383a77617aea43f9f766b17 (diff)
downloadthml2gmi-514e82b5c4c2dbced26d6e230bdc11a3aff523d0.tar.gz
Argument and italic Paragraphs: Parse as blockquote
-rwxr-xr-xthml2gmi.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/thml2gmi.py b/thml2gmi.py
index 8d3f224..38d542f 100755
--- a/thml2gmi.py
+++ b/thml2gmi.py
@@ -16,8 +16,10 @@ def iprint(string):
 def parseSomething(thing):
     if(len(thing.tag) == 4 and thing.tag[:3] == 'div'):
         parseDiv(thing)
-    elif (thing.tag in ['argument', 'div', 'p']):
+    elif (thing.tag in ['div', 'p']):
         parseP(thing)
+    elif (thing.tag == 'argument'):
+        iprint("> "); parseInline(thing); print("")
     elif (thing.tag in ['a', 'cite', 'name', 'scripRef', 'span']):
         parseInline(thing)
     elif (thing.tag == 'i'):
@@ -37,6 +39,10 @@ def parseDiv(div):
         parseSomething(child)
 
 def parseP(p):
+    i = p.find('i')
+    if (not p.text) and i is not None and len(p) == 1 and (not i.tail):
+        iprint("> ")
+        p = i
     parseInline(p)
     # Each paragraph should end with a newline
     print("")