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
{{ message }}
Repository navigation
mediawiki format: literal pipes in cells/headers silently split columns #499
tablefmt="mediawiki" does not escape | in cell or header content, so any literal pipe silently splits the cell into extra columns on a real MediaWiki wiki:
Rendered on a wiki, every pipe becomes a column separator: the header row gains a spurious empty column, x | y becomes two cells, and a || b becomes three — the data is silently corrupted.
This is the same class as the escaping the github/pipe formats already do for their separator (x | y is rendered as x \| y there), and the same class prettytable fixed for its MediaWiki emitter (prettytable #544): a literal pipe inside a MediaWiki table cell must be written |.
The header row has the same problem with !: a header cell containing !! splits into extra header columns.
Fix direction
Escape | as | in cell and header values in _mediawiki_row_with_attrs (and ! as ! in header rows), the way _html_row_with_attrs HTML-escapes values for the html/unsafe_html formats. Newlines inside cells are a separate, already-tracked multiline-support TODO, so they are out of scope here.
Activity