Skip to content

Markdown Importer: Show pipes in table cell code without the escaping backslash - #1254

Open
obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:fix/markdown-table-escaped-pipes
Open

obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:fix/markdown-table-escaped-pipes

Conversation

@obenland

Copy link
Copy Markdown
Member

Fixes https://meta.trac.wordpress.org/ticket/5123

A pipe inside a Markdown table cell has to be escaped as \|. GitHub Flavored Markdown removes that backslash anywhere in the cell, including inside code spans, so GitHub shows string|null. Jetpack’s parser only drops it outside code spans, so imported handbook pages show the backslash. The packages-env page currently has five such cells, for example the type of core, phpVersion and mariadbVersion reads string\|null.

After the Markdown transform, the importer now replaces \| with | inside <td> and <th> elements. Code outside tables and fenced code blocks keep their backslashes, as in GFM.

Testing

  1. Before: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#wp-env-json shows string\|null in the Type column, and .<path>\|~<path> and /<path>\|<letter>:\<path> in the source type table.
  2. With the patch applied, re-import that page (or run the Block Editor handbook import).
  3. The same cells read string|null, .<path>|~<path> and /<path>|<letter>:\<path> (the backslash before <path> stays, as on GitHub).
  4. Check a code span with \| outside a table, and a fenced code block containing \|: both keep the backslash.

Running the Jetpack parser on the current packages/env/README.md before and after this change differs in exactly those five cells.

🤖 Generated with Claude Code

… backslash

Markdown tables need a pipe in a cell escaped as `\|`, and GitHub Flavored
Markdown removes that backslash anywhere in the cell, including inside code
spans. Jetpack's parser only does so outside code spans, so imported handbook
pages showed values like `string\|null` where the source means `string|null`.

Remove the escaping backslash inside table cells after the transform.

Fixes #5123.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 12, 2026 18:39
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland, noisysocks.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d3455b7-a1a4-485c-a5da-3115c542ced3
Commits

Reviewing files that changed from the base of the PR and between 71d6cda and 0db4b4d.

Files selected for processing: 1

  • wordpress.org/public_html/wp-content/plugins/wporg-markdown/inc/class-importer.php
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@obenland

Copy link
Copy Markdown
Member Author

@propsbot add noisysocks

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.

2 participants