Skip to content

Fix #258: Allow escaping pipes within tables#261

Merged
quantizor merged 1 commit intoquantizor:masterfrom
ariabuckles:table-allow-escaping-separators
Aug 6, 2019
Merged

Fix #258: Allow escaping pipes within tables#261
quantizor merged 1 commit intoquantizor:masterfrom
ariabuckles:table-allow-escaping-separators

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