You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One hack is to store temporary replace codes with a placeholder:
--- a/neoteroi/mkdocs/markdown/tables/__init__.py+++ b/neoteroi/mkdocs/markdown/tables/__init__.py@@ -115,6 +115,15 @@ def read_table(markdown: str, cls: Type[T] = Table) -> Optional[T]:
records: List[List[str]] = []
for line in markdown.splitlines():
++ # Code blocks could contain pipes, so we need to store them and replace them later+ code = []+ def store(match):+ code.append(match.group(0))+ return f"@@{len(code) - 1}@@"++ line = re.sub(r"`[^`]+`", store, line)+
if _TABLE_SEPARATOR_LINE_PATTERN.match(line):
continue
@@ -122,6 +131,11 @@ def read_table(markdown: str, cls: Type[T] = Table) -> Optional[T]:
if matches:
row = [match.group(1).strip() for match in matches]
++ for i, cell in enumerate(row):+ row[i] = re.sub(+ r"@@(\d+)@@", lambda m: code[int(m.group(1))], cell)+
if not headers:
headers = row
else:
The text was updated successfully, but these errors were encountered:
The following will fail:
One hack is to store temporary replace codes with a placeholder:
The text was updated successfully, but these errors were encountered: