fix(web): repair malformed strong-emphasis spacing in assistant output - #786
Open
p421098 wants to merge 1 commit into
Open
fix(web): repair malformed strong-emphasis spacing in assistant output#786p421098 wants to merge 1 commit into
p421098 wants to merge 1 commit into
Conversation
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
Assistant responses can contain malformed strong-emphasis Markdown such as:
CommonMark does not recognize this as strong emphasis because whitespace appears immediately before the closing
**, so the raw delimiters remain visible.This PR:
**label: **valuepattern by moving the whitespace after the closing delimiter;AssistantResponse;The example above becomes:
Related Issues
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit run --all-filesand fixed any issues.Verification
pre-commit run --all-files: blocked by existing repository-wide formatting drift and Windows mypy errors for POSIX-only APIs outside this changenpm run test:node: 390 passednpm run lint: 0 errors; 56 pre-existing warnings in untouched filesnpx tsc --noEmit: passednpm run build: passedpre-commit run --files web/components/common/AssistantResponse.tsx web/lib/markdown-display.ts web/tests/markdown-display.test.ts: passedgit diff --check: passedAdditional Notes
The normalization is intentionally not added globally to
normalizeMarkdownForDisplay(). Restricting it to assistant text avoids changing user notes, CoWriter content, thinking blocks, or other strict Markdown surfaces.