Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix markdown escape pipe character in table cell #813

Merged

Conversation

straight-shoota
Copy link
Member

There is some disagreement between Markdown parsers about escaping pipe characters (|) inside a table cell. Python-markdown, which is used by our site generator mkdocs, considers a pipe inside a code span as escaped (`|`) (Python-Markdown/markdown#436). Most other Markdown parsers, including ones used in tooling (such as markdownlint) require explicit escaping (`\|`). Python-markdown would render the backslash:

grafik

This is a known interoperability issue based on different implementations of a Markdown parser (mkdocs/mkdocs#2761). There's no expectation for this to get fixed somewhow, so we can only apply a workaround to use code that different parsers agree upon: This patch replaces backticks with HTML <code> tags, for which all parsers require escaping the pipe character.

Copy link

netlify bot commented Jan 13, 2025

Deploy Preview for crystal-book ready!

Name Link
🔨 Latest commit e797ad7
🔍 Latest deploy log https://app.netlify.com/sites/crystal-book/deploys/678515949ee457000816ab56
😎 Deploy Preview https://deploy-preview-813--crystal-book.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@Fryguy Fryguy left a comment

Choose a reason for hiding this comment

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

I just saw this same issue over the weekend - glad to see it fixed.

@straight-shoota
Copy link
Member Author

Yeah, I picked it up from a Discord conv. Shout out to @mjblack for noticing the issue.

@straight-shoota straight-shoota merged commit 9fa052b into crystal-lang:release/1.15 Jan 14, 2025
6 checks passed
@straight-shoota straight-shoota deleted the fix/table-format branch January 14, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants