Skip to content

Commit

Permalink
Added support for converting --- in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ijacobs-cpa committed Sep 28, 2023
1 parent 5f96795 commit ed50a9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion convertUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def markdownfeat(filestream, input_filename):
modified_lines.append(f'<h1>{line[1:].strip()}</h1>')

# Check if the line starts with markdown prefixes
elif line.startswith('[') or line.startswith('*') or line.startswith('**') or line.startswith('#') or line.startswith('##') or line.startswith("<h1>"):
elif line.startswith('[') or line.startswith('*') or line.startswith('**') or line.startswith('#') or line.startswith('##') or line.startswith("<h1>") or line.startswith('---'):
modified_lines.append(line) # Append the line as is (if it does not meet the conditions)
else:
# Check if the line is empty
Expand All @@ -110,6 +110,8 @@ def markdownfeat(filestream, input_filename):
content = content.replace('*', '<em>', 1)
content = content.replace('*', '</em>', 1)

content = content.replace('---', '<hr />')

# Convert links format with HTML links (you need to define the markdown_to_html_links function)
content = markdown_to_html_links(content)

Expand Down

0 comments on commit ed50a9d

Please sign in to comment.