Skip to content

Commit

Permalink
added markdown support for horizontal rule
Browse files Browse the repository at this point in the history
  • Loading branch information
lmpham1 committed Sep 30, 2021
1 parent 7da5863 commit f8d1af2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def createMarkdownString(filename, contents, stylesheets):
htmlContent = re.sub('\*\*([^\s\*.]{1}.*?)\*\*|__([^\s_.]{1}.*?)__', r'<strong>\1\2</strong>', htmlContent)
htmlContent = re.sub('\*([^\s\*.]{1}.*?)\*|_([^\s\_.]{1}.*?)_', r'<em>\1\2</em>', htmlContent)
htmlContent = re.sub('\[(.+)\]\((.+)\)', r'<a href="\2">\1</a>', htmlContent)

blockQuoteParser = lambda matchedContent: "<blockquote>\n{}\n</blockquote>".format(re.sub("<\/?p>", "", matchedContent.group(1)))
htmlContent = re.sub(r'```\r?\n(((?!```)[\s\S])+)```', blockQuoteParser, htmlContent)
htmlContent = re.sub('(\n|(\n<p>))\s{0,3}((---)|(\*\*\*))\s{0,3}((</p>\n)|\n)', r'\n<hr/>\n', htmlContent)
# blockQuoteParser = lambda matchedContent: "<blockquote>\n{}\n</blockquote>".format(re.sub("<\/?p>", "", matchedContent.group(1)))
# htmlContent = re.sub(r'```\r?\n(((?!```)[\s\S])+)```', blockQuoteParser, htmlContent)

return htmlContent

Expand Down

0 comments on commit f8d1af2

Please sign in to comment.