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 #258: Allow escaping pipes within tables #261

Merged

Conversation

ariabuckles
Copy link
Collaborator

Should fix #258

A port of ariabuckles/simple-markdown@f32a628
to markdown-to-jsx.

Previously, tables were parsed using String.prototype.split on pipe
(|) characters.

This PR changes table parsing to use a full parse() call, using a
new tableSeparator rule to match tableSeparators. Because
tableSeparator is now a rule, the escapedText rule can handle
escaped pipes within the table, and the codeInline rule can handle
inline code with pipes in it.

Test plan:

Added tests to index.compiler.spec.js

Should fix quantizor#258

A port of ariabuckles/simple-markdown@f32a628
to markdown-to-jsx.

Previously, tables were parsed using String.prototype.split on pipe
(`|`) characters.

This commit changes table parsing to use a full parse() call, using a
new `tableSeparator` rule to match tableSeparators. Because
`tableSeparator` is now a rule, the `escapedText` rule can handle
escaped pipes within the table, and the `codeInline` rule can handle
inline code with pipes in it.

Test plan:

Added tests to index.compiler.spec.js
@quantizor
Copy link
Owner

Thanks for this @ariabuckles! I'll take a look in the next day or two, really appreciate the contribution ❤️

@quantizor quantizor merged commit b540d02 into quantizor:master Aug 6, 2019
@ariabuckles
Copy link
Collaborator Author

Thanks for taking a look @probablyup !

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.

Escaped pipes are ignored within table cells
2 participants