mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4557] [Issue]: Newlines between adjacent inline HTML elements are deleted #2486
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#2486
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 @Mininimin on GitHub (Aug 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4557
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Newlines between adjacent inline HTML elements are deleted.
Expected behavior
If the AI writes:
<span style="color: #F8BBD0">"Hi."</span>
<span style="color: #FFF59D">"Hello."</span>
I would expect that to display as:
"Hi."
"Hello."
Actual behavior
It is instead written as:
"Hi." "Hello."
Steps to reproduce
Environment
Logs, screenshots, or video
Additional context
The fix provided by Professor Mari:
The Bug
In packages/client/src/components/chat/ChatMessage.tsx, the newline-to-
regex had three alternatives:
Alternative 2 assumed any newline between angle brackets was pretty-printed HTML indentation (like </div>\n<p>), so it stripped it. But it also ate intentional line breaks between sibling elements like two <span> tags, gluing them together on one line.
The Fix
Line 1068 — changed alternative 2's replacement from ${pre}${post} (eat the newline) to ${pre}<br style="display:block;margin:0.2em 0">${post} (insert a styled <br> between the tags).
The styled <br> gives a small visual gap that mimics paragraph spacing. Block-level elements like <div> ignore stray <br> spacing naturally, so the old pretty-printing concern is handled for free.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Aug 4, 2026):
🔧 Ownership note: @SpicyMarinara is handling this in the current focused issue sweep. The fix will preserve intentional line breaks between adjacent inline HTML elements without changing block-element source formatting. A draft PR targeting
stagingwill follow shortly.@SpicyMarinara commented on GitHub (Aug 4, 2026):
Shipped to staging in #4560 (merge commit
156f4189e6).