Repository navigation
Conversation
TableFinder now marks the lines of fenced code blocks (``` and ~~~, GFM 4.5) and skips them, so table-shaped lines in code samples are left as they are. A closing fence must use the same character and be at least as long as the opening one; an unclosed fence runs to the end of the document. Ignore markers inside a fence are ignored too. Fixes darkriszty#120
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.
Fixes #120.
TableFindernow marks the lines of fenced code blocks and skips them, the same way it skips ignore blocks. Table-shaped lines in code samples are left as they are.Rules (GFM 4.5):
`or~(leading spaces allowed). A backtick fence with a backtick in its info string is inline code, not a fence (```|a|```).is not closed by``` ````.<!-- markdown-table-prettify-ignore-start -->inside a fence (for example in a docs sample) no longer starts an ignore block.This covers all three paths that use
TableFinder: format document, format table at cursor, and the CLI /--check.Tests:
TableFinderunit tests; 6 fail before the fix (the inline-code one is a guard and passes on both).fencedCodeBlocks-input.md/-expected.md; fails before.npm run --silent check-md < README.mdnow passes (it failed before, as the issue says).I ran the unit and CLI system tests with mocha (351 passing). The VS Code host could not start on my machine, so the
vsPrettyfiersystem tests will run in CI.