adjusted the rules to match paprika3

This commit is contained in:
Steve Dogiakos 2022-12-09 17:14:42 -07:00
parent ffd0682a00
commit 01273dfaab
1 changed files with 4 additions and 3 deletions

View File

@ -11,12 +11,13 @@ def convert_md_to_paprika3(file_path):
formatted_contents = re.sub(r"## (.*)", r"<h2>\1</h2>", formatted_contents) formatted_contents = re.sub(r"## (.*)", r"<h2>\1</h2>", formatted_contents)
formatted_contents = re.sub( formatted_contents = re.sub(
r"### (.*)", r"<h3>\1</h3>", formatted_contents) r"### (.*)", r"<h3>\1</h3>", formatted_contents)
formatted_contents = re.sub(
r"__(.*)__", r"<strong>\1</strong>", formatted_contents)
formatted_contents = re.sub( formatted_contents = re.sub(
r"\*\*(.*)\*\*", r"<strong>\1</strong>", formatted_contents) r"\*\*(.*)\*\*", r"<strong>\1</strong>", formatted_contents)
formatted_contents = re.sub(r"_(.*)_", r"<em>\1</em>", formatted_contents) formatted_contents = re.sub(r"_(.*)_", r"<em>\1</em>", formatted_contents)
# write the formatted text to a new file formatted_contents = re.sub(
with open(file_path[:-3] + ".paprika3", "w") as f: r"\*(.*)\*", r"<em>\1</em>", formatted_contents)
f.write(formatted_contents)
# prompt the user for the folder path # prompt the user for the folder path