Skip to content
Snippets Groups Projects
Commit 22f67aca authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix for the italic conversion

parent a88ef036
No related branches found
No related tags found
1 merge request!1Restructuring and cleaning scripts for Mkdocs
...@@ -494,7 +494,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR ...@@ -494,7 +494,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
# Italic replacements # Italic replacements
# Regex to detect markdown italic formatting in cell content # Regex to detect markdown italic formatting in cell content
if cell.content is not None: if cell.content is not None:
cell.content = matchItalic.sub(r'<i>\g<text></i>', cell.content) cell.content = matchItalic.sub(r'\1<i>\g<text></i>', cell.content)
# Correct newlines characters # Correct newlines characters
for headerRow in headerRows: for headerRow in headerRows:
......
...@@ -37,4 +37,4 @@ matchTable = re.compile(r'^\s*\|.*\|\s*$', re.IGNORECASE) ...@@ -37,4 +37,4 @@ matchTable = re.compile(r'^\s*\|.*\|\s*$', re.IGNORECASE)
matchTableSeparator = re.compile(r'^\s*\|([-: ]+\|)+\s*$', re.IGNORECASE) matchTableSeparator = re.compile(r'^\s*\|([-: ]+\|)+\s*$', re.IGNORECASE)
matchBold = re.compile(r'(^|\s)(\*\*|__)(?P<text>.+?)\2(?!\w)') matchBold = re.compile(r'(^|\s)(\*\*|__)(?P<text>.+?)\2(?!\w)')
matchItalic = re.compile(r'(^|\s)(\*|_)(?P<text>.+?)(?<!\\)\3(\s|$)') matchItalic = re.compile(r'(^|\s)(\*|_)(?P<text>.+?)\2(?!\w)')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment