Skip to content

Commit

Permalink
After both merges
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanaz2 committed Sep 30, 2022
2 parents 4c9657a + 00eff62 commit 8302b57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SSJ.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] + "</"+ tag +">" + 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] + "</"+ tag +">" + newLine[match.span()[1]:]
match = re.search(regex,newLine)
return newLine

Expand All @@ -154,6 +157,7 @@ def convertMarkdown(line):
#code
newLine = SSJ.markdownSearch("\`\`\`[^*]+\`\`\`", 3, "code", newLine)
newLine = SSJ.markdownSearch("\`[^*]+\`", 1, "code", newLine)

#hr
newLine = SSJ.markdownSearch("\-\-\-[^*]", 3, "hr", newLine)

return newLine

0 comments on commit 8302b57

Please sign in to comment.