mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1126] [Bug]: Bare <speaker> tags (no name attribute) render as literal text #556
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#556
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aeriondyseti on GitHub (May 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1126
Originally assigned to: @cha1latte on GitHub.
What's happening
The plain-text rendering path in
ChatMessage.tsxstrips well-formed<speaker="Name">...</speaker>tags just fine, but bare<speaker>...</speaker>(nonameattribute) slips through and shows up in the chat as literal text.What should happen
Bare
<speaker>tags should either be stripped like the named version, or filtered out upstream. Either's fine — consistency is what matters.What actually happens
A message containing
<speaker>hello</speaker>renders the literal characters<speaker>hello</speaker>in the message body.Why it's happening
Two regexes in the file disagree about what a speaker tag looks like:
/<\/?speaker(?:="[^"]*")?>/g— name attribute optionalSPEAKER_TAG_RE(around line 250):/<speaker="([^"]*)">([\s\S]*?)<\/speaker>/g— name attribute requiredThe stripper removes wrappers from a temporary copy so it can decide whether the message contains "real" HTML, but it doesn't touch the original text. The plain-text branch then runs the stricter renderer regex against that unmodified text, fails to match bare tags, and they fall through to the highlighter unchanged.
How to reproduce
<speaker>some text</speaker>(without aname="..."attribute).Possible fix
Pick a side and align the two regexes — either teach the renderer to accept bare tags (treat speaker as null), or require name attributes everywhere and sanitize the bare ones out earlier. The right choice probably depends on #1127 (the parse/render refactor) — that's a more natural place to settle this.
Surfaced during code review of #1125. Pre-existing, not introduced by that PR.
@cha1latte commented on GitHub (May 25, 2026):
Closed in #1202