Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial checklist
Description of changes
Closes GH-11.
inlineCodeWithTableputs a backslash before every|in code in a cell. When the pipe already has a backslash in front of it, that makes\\|. The first backslash then escapes the second, the pipe acts as a cell delimiter, and the row reads back with an extra cell.This changes the handler to count the backslashes before each pipe and only add one when the count is even, so the pipe always ends up after an odd run and stays in the cell:
a|b`a\\|b`(row splits)`a|b`a\|b`a\\|b`|`\\|`(row splits)`|`GFM has no way to write a backslash right before a pipe in code in a cell (
\|reads as|, and from-markdown keeps\\as\\). So a value with an odd number of backslashes before a pipe loses one backslash, as the issue suggests:a\|breads back asa|b. The row structure is kept, which matters more. Values with an even count, likea\\|b, round-trip exactly.Tests: two new cases. One checks the serialized output, the other round-trips a table through
toMarkdownandfromMarkdownfor several backslash/pipe combinations and checks the cell count and code value. Both fail without the change.npm test(build, type coverage, format, 100% coverage) passes.I used an AI coding assistant to help write this change. I reviewed and tested the result myself.