mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3243] [MERGED] fix: parse markdown headings in files with CRLF line endings #5859
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#5859
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3243
Author: @kolacheee
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/markdown-crlf-line-endings📝 Commits (1)
0a4f349fix: parse markdown headings in files with CRLF line endings📊 Changes
1 file changed (+4 additions, -1 deletions)
View changed files
📝
packages/client/src/lib/markdown.tsx(+4 -1)📄 Description
Fixes #3242
Summary
renderMarkdownBlockssplit content on"\n"only, so text with Windows CRLF line endings left a trailing\ron every line. The heading regex (/^(#{1,6})\s+(.+)$/) cannot match across a carriage return, so headings in CRLF files rendered as literal# ...plain text. Now the renderer splits on/\r?\n/, making CRLF and LF input parse identically.Why
The seeded
CREDITS.mdin Game Assets arrives with CRLF endings on Windows (git converts it at checkout, and the seeder copies it byte-for-byte), so every Windows install shows broken headings when previewing it — while tables in the same file render fine, because the table parser happens to.trim()each line. Any markdown file written by a Windows editor and imported into game assets hits the same problem. Fixing it at the line-split also protects the parser's other line-anchored patterns that don't trim, instead of patching regexes one by one.Known limitations
The separate
applyInlineMarkdownHTMLpath (sanitized-HTML pipeline where newlines are already<br>tags) is untouched — whether\rcan survive into that pipeline depends on the upstream sanitizer and there is no observed repro there.Note: the full styled result in the file preview also needs #3241 (the preview's CSS scoping fix, separate PR). This fix is observable independently: with it, the
#marks are consumed and real<h1>–<h6>elements are emitted.Test plan
CREDITS.md→ Preview shows "Game Assets Credits", "Music", etc. as headings with no literal#marks# Heading, a list, and a table — everything still renders as beforepnpm checkpasses locally.UI Evidence
How

credits.mdappears now:With both this and #3241 applied:

Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.