From 00eff622fbeef6fd531dc788596611002ce837c5 Mon Sep 17 00:00:00 2001 From: stefanaz2 Date: Fri, 30 Sep 2022 17:03:08 -0400 Subject: [PATCH] Added hr support --- SSJ.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SSJ.py b/SSJ.py index b12584a..7a8cccd 100644 --- a/SSJ.py +++ b/SSJ.py @@ -139,7 +139,10 @@ def markdownSearch(regex, indChars, tag, line): newLine = line match = re.search(regex,newLine) while match != None: - newLine = newLine[:match.span()[0]] + "<" + tag + ">" + newLine[match.span()[0]+indChars:match.span()[1]-indChars] + "" + newLine[match.span()[1]:] + if (tag == "hr"): + newLine = newLine[:match.span()[0]] + "<" + tag + ">"+ newLine[match.span()[1]:] + else: + newLine = newLine[:match.span()[0]] + "<" + tag + ">" + newLine[match.span()[0]+indChars:match.span()[1]-indChars] + "" + newLine[match.span()[1]:] match = re.search(regex,newLine) return newLine @@ -151,6 +154,7 @@ def convertMarkdown(line): #italics newLine = SSJ.markdownSearch("\*[^*]+\*", 1, "i", newLine) newLine = SSJ.markdownSearch("_[^*]+_", 1, "i", newLine) - + #hr + newLine = SSJ.markdownSearch("\-\-\-[^*]", 3, "hr", newLine) return newLine \ No newline at end of file