Table cells: handle escaped \| (literal pipe) — coordinated server+client follow-up to #1 #2

Open
opened 2026-07-02 16:43:38 +00:00 by gffranco · 0 comments
Owner

Follow-up to #1. That fix made the table lexer skip | inside [[…]] / {{…}} / `code`, but intentionally left backslash-escaped \| unhandled, because skipping it in cell_bar_positions alone would leave a stray \ in the rendered cell (the inline lexer has no escape handling).

This tracks doing \| properly so a cell like | a\|b | is one cell whose content is a literal a|b.

What's needed (both must land together)

Server (nuwiki-rs)

  1. In the table-row lexer's cell-boundary scan, treat \| as literal (don't split there).
  2. In lex_inline (or a table-cell pre-pass), unescape \|| so the emitted text/HTML shows a literal pipe with no stray backslash.
  3. Regression: | a\|b | lexes to one 2-column row and exports a <td> containing a|b.

Client (gffranco/nuwiki)
Once the server unescapes, re-add the \| skip to cell_bar_positions in both lua/nuwiki/commands.lua and autoload/nuwiki/commands.vim so the editor's auto-alignment keeps a\|b as one cell and stays consistent with export.

Current state (intentional, consistent)

Until this lands, both sides split on \| — the client's \| skip was removed in gffranco/nuwiki 5375e30 specifically so the buffer and the HTML export agree. \| in a table cell is uncommon, so this is low priority; the two repos just need to flip together.

Follow-up to #1. That fix made the table lexer skip `|` inside `[[…]]` / `{{…}}` / `` `code` ``, but intentionally left backslash-escaped `\|` unhandled, because skipping it in `cell_bar_positions` alone would leave a stray `\` in the rendered cell (the inline lexer has no escape handling). This tracks doing `\|` properly so a cell like `| a\|b |` is **one** cell whose content is a literal `a|b`. ## What's needed (both must land together) **Server (nuwiki-rs)** 1. In the table-row lexer's cell-boundary scan, treat `\|` as literal (don't split there). 2. In `lex_inline` (or a table-cell pre-pass), unescape `\|` → `|` so the emitted text/HTML shows a literal pipe with no stray backslash. 3. Regression: `| a\|b |` lexes to one 2-column row and exports a `<td>` containing `a|b`. **Client (gffranco/nuwiki)** Once the server unescapes, re-add the `\|` skip to `cell_bar_positions` in both `lua/nuwiki/commands.lua` and `autoload/nuwiki/commands.vim` so the editor's auto-alignment keeps `a\|b` as one cell and stays consistent with export. ## Current state (intentional, consistent) Until this lands, **both** sides split on `\|` — the client's `\|` skip was removed in `gffranco/nuwiki` `5375e30` specifically so the buffer and the HTML export agree. `\|` in a table cell is uncommon, so this is low priority; the two repos just need to flip together.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gffranco/nuwiki-rs#2