Repository navigation
Conversation
Markdown only opens a code block at the start of a line. When the model writes a card's opening fence right after a sentence, the card shows as raw text and its closing fence opens a code block that swallows the rest of the answer. Move such fences to their own line before rendering and before copying.
✅ Deploy Preview for docsdocker ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
trungutt
marked this pull request as ready for review
November 26, 2026 20:45
This branch has not been deployed
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.
Description
The docs chat draws a card for each
openui-langcode block in an answer. Sometimes the model writes the card's opening fence at the end of a sentence instead of on its own line. Markdown only opens a code block at the start of a line, so the card shows up as raw text. Worse, the card's closing fence then opens a new code block that never closes, and it swallows the rest of the answer, including the sources.Before rendering an answer, and before copying it, the chat now moves any
openui-langopening fence that follows other text onto its own line. Fences that already start a line, and longer backtick runs, are left alone. The fix works while an answer is still streaming.Before (what the model sends, drawn as raw text with the sources inside a code block):
After (what the chat renders and copies):
To verify, run
node --test hack/test/gordon-card-*.mjs. To check it in the browser, render an answer in the chat whose card fence follows a sentence on the same line. The card should draw, the sources should render as a list, and Copy should give the card as markdown.Reviews