renderer: improve markdown_to_latex

This commit is contained in:
Sina Atalay 2024-03-11 20:29:37 +01:00
parent 2847b1ef6d
commit c22fe57522
1 changed files with 2 additions and 2 deletions

View File

@ -383,7 +383,7 @@ def markdown_to_latex(markdown_string: str) -> str:
markdown_string = markdown_string.replace(old_link_string, new_link_string) markdown_string = markdown_string.replace(old_link_string, new_link_string)
# convert bold # convert bold
bolds = re.findall(r"\*\*([^\*]*)\*\*", markdown_string) bolds = re.findall(r"\*\*(.+?)\*\*", markdown_string)
if bolds is not None: if bolds is not None:
for bold_text in bolds: for bold_text in bolds:
old_bold_text = f"**{bold_text}**" old_bold_text = f"**{bold_text}**"
@ -392,7 +392,7 @@ def markdown_to_latex(markdown_string: str) -> str:
markdown_string = markdown_string.replace(old_bold_text, new_bold_text) markdown_string = markdown_string.replace(old_bold_text, new_bold_text)
# convert italic # convert italic
italics = re.findall(r"\*([^\*]*)\*", markdown_string) italics = re.findall(r"\*(.+?)\*", markdown_string)
if italics is not None: if italics is not None:
for italic_text in italics: for italic_text in italics:
old_italic_text = f"*{italic_text}*" old_italic_text = f"*{italic_text}*"