Fix markdown-table <br> cell overflow - #273
Open
El-Patronum wants to merge 1 commit into
Open
Conversation
Models (notably thinking-mode) emit <br> for in-cell line breaks in markdown tables. Foundation's AttributedString(markdown:) returns raw HTML as literal tag text, so the cell rendered '<br>' verbatim AND kept the whole cell as one unbreakable token that overflowed the fixed column frame into its neighbour (the "pile of overlapping text"). Convert <br> variants to real newlines at the single cell choke point (AssistantMarkdownView.inline) so cells wrap. Comparison operators are untouched: the pattern requires the literal 'br'. Fixes youssofal#272.
El-Patronum
force-pushed
the
fix/table-br-overflow-and-presets
branch
from
August 17, 2026 12:14
483cd92 to
d67e986
Compare
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 #272.
(This PR originally also carried an unrelated Profile sampling-presets feature. That has been dropped — this PR is now the bug fix alone. The branch name is a leftover from that earlier scope.)
Bug: markdown-table
<br>cell overflowModels (notably thinking-mode) emit
<br>for in-cell line breaks in markdown tables.AssistantMarkdownView.inline(_:)hands the raw cell substring to Foundation'sAttributedString(markdown:), which returns raw-HTML nodes as literal tag text — so the cell rendered<br>verbatim and kept the whole cell as one unbreakable token that overflowed the fixed column frame into its neighbour (the "pile of overlapping text").Both symptoms trace to that one mechanism in one function — the single choke point every table cell routes through.
Fix
Normalize
<br>variants to real newlines at that choke point, before markdown attribution, so cells wrap:Comparison operators (
a < b) are untouched — the pattern requires the literalbr.Known ceiling, marked with a deliberate
ponytail:comment: other raw tags (<b>,<span>) would still render raw. A blanket tag-strip was rejected because it mangles bare</>(verified:a < b and c > d→a d). If those tags show up in practice, the follow-up is a tag allowlist at the same choke point.Proof
AttributedString(markdown:)API:"foo<br>bar<br>baz"→"foo<br>bar<br>baz"(one unbreakable line, literal tags)"foo<br>bar<br>baz"→"foo\nbar\nbaz"(three wrappable lines, no tags)swift buildclean on this branch, no new warnings in the touched file.swift test: 574 tests, 0 failures. (A timing-sensitive daemon-supervisor test inMTPLXAppCoreflakes under the full run on this machine but passes in isolation, with and without this change; it is unreachable from this view-only diff.)