From 22f67aca686a2d51a8243f221cd491a9ee3c661e Mon Sep 17 00:00:00 2001
From: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
Date: Thu, 27 Feb 2025 15:17:16 +0100
Subject: [PATCH] Fix for the italic conversion

---
 toMkdocs/gridTableTools.py | 2 +-
 toMkdocs/regexMatches.py   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/toMkdocs/gridTableTools.py b/toMkdocs/gridTableTools.py
index 2dd122a..ea3217f 100644
--- a/toMkdocs/gridTableTools.py
+++ b/toMkdocs/gridTableTools.py
@@ -494,7 +494,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
 					# Italic replacements
 					# Regex to detect markdown italic formatting in cell content
 					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
 	for headerRow in headerRows:
diff --git a/toMkdocs/regexMatches.py b/toMkdocs/regexMatches.py
index ba1fc15..cbac6c3 100644
--- a/toMkdocs/regexMatches.py
+++ b/toMkdocs/regexMatches.py
@@ -37,4 +37,4 @@ matchTable = re.compile(r'^\s*\|.*\|\s*$', re.IGNORECASE)
 matchTableSeparator = re.compile(r'^\s*\|([-: ]+\|)+\s*$', re.IGNORECASE)
 
 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
-- 
GitLab