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