Repository navigation
[Console] Escape pipes and newlines in markdown tables - #66942
Merged
nicolas-grekas merged 1 commit intoOct 14, 2026
Merged
Conversation
Contributor
Author
|
The Fabbot failure is a codespell false positive. It flags the author name "Max Grigorian" in the Table.php header, a line this PR does not change, so I left it as is. |
nicolas-grekas
force-pushed
the
fix/issue-66941-markdown-table-escaping
branch
from
October 14, 2026 16:28
f72fe6c to
4c2a7c0
Compare
Member
|
Thanks @lazerg. I squashed a fix into your commit. The escaping now runs after I kept your backslash case, but the backslash is now doubled. With |
Member
|
Thank you @lazerg. |
4 of 5 tasks
nicolas-grekas
added a commit
that referenced
this pull request
Oct 18, 2026
…kas) This PR was merged into the 6.4 branch. Discussion ---------- Add "grigorian" to the codespell ignore list | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Fabbot's codespell step reads the ``@author` Max Grigorian` line of Console's `Table` helper as a typo (`Grigorian ==> Gregorian`), so every PR that touches this file gets a red check, as #66942, #67092 and #67128 did. Commits ------- bc92e25 Add "grigorian" to the codespell ignore list
amenk
added a commit
to iMi-digital/shopware
that referenced
this pull request
Nov 3, 2026
Symfony 7.4.22 escapes pipes and line breaks in the markdown table style itself (symfony/symfony#66942), so the escaping in renderFormattedTable() is no longer needed.
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.
The
markdowntable style writes cell content as is. A|in a cell opens an extra column, and a newline in a cell is split into a second table row, so the output is no longer valid markdown.The table now escapes cells when the
markdownstyle is in use:|becomes\|, and\n,\r\nor\rbecomes<br>. A backslash before a line break is doubled, so that markdown does not read\<br>as an escaped<. This happens inbuildTableRows(), aftersetColumnMaxWidth()wraps the cell and before the column widths are computed, so the padding stays aligned. With themarkdownstyle, wrapped lines also become<br>instead of extra rows. Colspan and cell styles are kept.I added a case to
renderProviderthat fails without the fix../phpunit src/Symfony/Component/Consolepasses, except twoQuestionHelperTestfailures that also happen on 7.4 without this change in my local environment. The patch also applies cleanly to 8.2.