diff --git a/uml.py b/uml.py index e620c17..84dbf4c 100644 --- a/uml.py +++ b/uml.py @@ -129,6 +129,7 @@ def renderer(chain): chain = [] flags = { "TABLE_PREV": False, + "PARA_PREV": False, } def main(): for i in finput(): @@ -138,7 +139,16 @@ def main(): if len(i) == 0: continue # lines with text - if i[0].isalpha(): chain.append(Element("p", i)) + if i[0].isalpha(): + if not flags["PARA_PREV"]: + flags["PARA_PREV"] = True + chain.append(Element("p", i)) + else: + if not chain[-1].data[-1] == " ": + chain[-1].data += " " + i + else: + chain[-1].data += i + continue # we have a processing command if not i[0].isalpha(): @@ -171,8 +181,8 @@ def main(): flags["TABLE_PREV"] = True continue flags["TABLE_PREV"] = False + flags["PARA_PREV"] = False continue -# printchain(chain) renderer(chain) if __name__ == "__main__": main()