Skip to content

Commit 2327462

Browse files
authored
fix: preserve escaped pipes in nexus page table cells (#61)
1 parent f5791c8 commit 2327462

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎scripts/generate-nexus-page.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ def md_to_bbcode(md: str) -> str:
105105
i += 1
106106
output.append("[list]")
107107
for row in table_lines[2:]: # skip header row [0] and separator row [1]
108-
cells = [convert_inline(c.strip()) for c in row.strip("|").split("|")]
108+
# Split on unescaped pipes only, then unescape `\|` within each cell.
109+
raw = re.split(r"(?<!\\)\|", row.strip().strip("|"))
110+
cells = [convert_inline(c.strip().replace("\\|", "|")) for c in raw]
109111
output.append(f"[*]{' — '.join(cells)}")
110112
output.append("[/list]")
111113
continue

0 commit comments

Comments
 (0)