Repository navigation
Escape pipes in symbols in the markdown reporter - #2254
Merged
webpro merged 1 commit intoOct 29, 2026
Merged
Conversation
commit: |
webpro
approved these changes
Oct 29, 2026
webpro
left a comment
Member
There was a problem hiding this comment.
Thanks for the pull request! The premise checks out: a duplicate export puts a pipe in the symbol, GFM reads it as a column separator and the severity cell falls off the row. Escaping it as \| renders the symbol back literally, and the output of every other fixture stays byte-identical, so this is the right size of fix.
Member
|
🚀 This pull request is included in v6.44.0. See Release 6.44.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
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.
Duplicate exports are reported with a symbol like
exportedResult|default, and the markdown reporter writes it into the table as is. In GFM an unescaped pipe is a column separator, so the row gets four cells under a three-column header:defaultends up under Location, the file path under Severity, and the severity is dropped. Similar to the broken table in #1700.This escapes
|in the symbol (before/after above) and uses the escaped value for the Name column width. The new test runs--reporter markdown --include duplicateson the existingexports/basicfixture.node --test test/cli/cli-reporter*.test.ts, 49 pass; the new test fails without the changebun test test/cli/cli-reporter-markdown.test.ts, passoxfmt --checkon the changed files, clean