Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,26 @@ private struct AssistantTableView: View {
}

private static func inline(_ text: String) -> AttributedString {
(try? AttributedString(
markdown: text,
// Models (notably thinking-mode) emit <br> for in-cell line breaks in
// markdown tables. cmark hands raw HTML back as literal tag text, so
// the cell would render "<br>" verbatim AND keep the whole cell as one
// unbreakable token that overflows the fixed column frame into its
// neighbour (the "pile of overlapping text"). Convert <br> variants to
// real newlines at this single choke point so cells wrap. Comparison
// operators ("a < b") are untouched: the pattern requires "br".
// ponytail: <br> only — other raw tags (<b>, <span>) would still show
// raw; strip-all mangles "<"/">", add a tag allowlist if they appear.
let readable = text.replacingOccurrences(
of: #"<br\s*/?>"#,
with: "\n",
options: [.regularExpression, .caseInsensitive]
)
return (try? AttributedString(
markdown: readable,
options: AttributedString.MarkdownParsingOptions(
interpretedSyntax: .inlineOnlyPreservingWhitespace
)
)) ?? AttributedString(text)
)) ?? AttributedString(readable)
}
}

Expand Down