You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
completePartialMarkdown appends closing markers to complete text (snake_case, 2 * 3, arr[0], task lists) #8399
completePartialMarkdown (exported from @copilotkit/core and @copilotkit/react-core, and called by @copilotkit/angular's renderMarkdown on every assistant message) treats any unpaired _ or * as an open emphasis and any [ not part of [text](url) as an unclosed bracket without handling closing ].
Complete Markdown inputs are returned unchanged ("Rename file_name.txt first.", "snake_case", "2 * 3 = 6", "Use arr[0] to read it.", "- [ ] buy milk"). Under CommonMark flanking rules, an _ between alphanumeric characters or a * followed by whitespace cannot open emphasis, and a closed [...] (such as arr[0] or a GFM task-list [ ]) is not an unclosed bracket.
❌ Actual Behavior
completePartialMarkdown appends _, *, or ] to the end of the text, which renders as literal trailing punctuation:
In packages/core/src/utils/markdown.ts, the character loop toggles italic_underscore / italic_star without checking surrounding whitespace or word characters, and pushes bracket on [ when not followed by (...) while never matching ].
Also reproduced on main (7b88608, with @copilotkit/[email protected] and [email protected]) and on @copilotkit/[email protected] (2.0.0 branch at 9a129143b, packages/core/src/utils/markdown/complete-partial-markdown.ts), Node.js v26.13.0.
Activity
copilotkit-outpost-bot commentedon Nov 14, 2026
This needs a maintainer review to give you a reliable next step.
🤖 Generated by CopilotKit AI Support · Documentation
Was this helpful? React with 👍 or 👎