Skip to content

Port upstream table escaped pipe fix#67

Open
Renakoni wants to merge 2 commits into
mainfrom
sync/upstream-4850-table-escaped-pipe
Open

Port upstream table escaped pipe fix#67
Renakoni wants to merge 2 commits into
mainfrom
sync/upstream-4850-table-escaped-pipe

Conversation

@Renakoni

@Renakoni Renakoni commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Port upstream MarkText PR #4850 into the Android Muya copy.
  • Fix escaped pipes inside table-cell inline code so the editor displays | / || instead of \| / \|\|.
  • Add regression coverage for editor rendering, table structure, and markdown round-trip behavior.

Upstream Source

Android Relevance

This directly affects Android's live Muya editor rendering. GFM table cells escape literal pipes as \|; after parsing, that escape should be stored as a literal pipe. The previous import path re-added \| into the stored table-cell text. That looked acceptable in plain cell text because the inline escape rule hides the backslash, but inside inline code the backslash is literal, so Android users saw code cells like \| instead of |.

Change Details

  • Remove table-cell import-time re-escaping from MarkdownToState.
  • Store table-cell text as marked emits it, with \| already resolved to literal |.
  • Keep round-trip behavior through the existing stateToMarkdown.escapeText serialization path, which re-escapes pipes when writing markdown.
  • Add tableEscapedPipe.spec.ts covering:
    • editor code rendering for `\|` and `\|\|`;
    • table row/cell structure preservation;
    • serialization round-trip for inline-code and plain-text escaped pipes.

Verification

  • pnpm --dir third_party/muya exec vitest run src/state/__tests__/tableEscapedPipe.spec.ts passed.
  • pnpm build passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant