From 0c19d47ad3f12319df2d9ad237ba667c64ccb103 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 30 Jun 2021 15:45:57 -0500 Subject: [PATCH] improve line blank code and add link descriptions --- uml.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/uml.py b/uml.py index 4a52235..7d238c5 100644 --- a/uml.py +++ b/uml.py @@ -140,8 +140,12 @@ def main(): for i in finput(): i = i.rstrip() - # ignore blank lines - if len(i) == 0: continue + # ignore blank lines (but not seperating paragraphs) + if len(i) == 0 and not flags["IN_PREFORMATTED"]: + if flags["PARA_PREV"]: + print("hi") + flags["PARA_PREV"] = False + continue # lines with text if i[0].isalpha() and not flags["IN_PREFORMATTED"]: @@ -185,7 +189,11 @@ def main(): elif command == "*": chain.append(Element("l", params)) elif command == "-": chain.append(Element("l", params)) elif command == ">": chain.append(Element("q", params)) - elif command == "=": chain.append(Element("r", params)) + elif command == "=": + splitted = params.split(' ') + url = splitted[0] + desc = ' '.join(splitted[1:]) + chain.append(Element("r", url, desc)) elif command == "|": if flags["TABLE_PREV"]: chain[-1].data.addrow(params)