renderer: fix a markdown parsing bug

This commit is contained in:
Sina Atalay 2024-03-29 19:05:41 +01:00
parent cd0ee54ffe
commit d0594f4a8f
1 changed files with 3 additions and 3 deletions

View File

@ -185,9 +185,9 @@ class LaTeXFile(TemplatedFile):
# ones with \textnormal: # ones with \textnormal:
# Find all the nested commands: # Find all the nested commands:
nested_commands = re.findall(r"\\textbf{.*?(\\textbf{.*?})", result) nested_commands = re.findall(r"\\textbf{[^}]*?(\\textbf{.*?})", result)
nested_commands += re.findall(r"\\textit{.*?(\\textit{.*?})", result) nested_commands += re.findall(r"\\textit{[^}]*?(\\textit{.*?})", result)
nested_commands += re.findall(r"\\underline{.*?(\\underline{.*?})", result) nested_commands += re.findall(r"\\underline{[^}]*?(\\underline{.*?})", result)
# Replace the inner commands with \textnormal: # Replace the inner commands with \textnormal:
for nested_command in nested_commands: for nested_command in nested_commands: