Skip to content

fix: prevent UTF-8 fence scanner panics - #265

Merged
alecdotdev merged 1 commit into
sftwrdotdev:masterfrom
PathGao:codex/fix-utf8-fence-slice
Jul 29, 2026
Merged

fix: prevent UTF-8 fence scanner panics#265
alecdotdev merged 1 commit into
sftwrdotdev:masterfrom
PathGao:codex/fix-utf8-fence-slice

Conversation

@PathGao

@PathGao PathGao commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Fixes #264.

The fenced-code scanner now reaches trimmed[run_len..] only after confirming an ASCII fence marker, a matching opener, and a sufficient marker run. Ordinary multibyte content inside a fenced block can no longer be sliced at a non-character byte boundary.

Adds a Rust regression test using Chinese-leading content inside a fenced code block, covering both no-panic behavior and continued processing after the closing fence.

Checks: cargo test, npm test, npm run check.

@PathGao
PathGao marked this pull request as ready for review July 28, 2026 09:17
@alecdotdev
alecdotdev merged commit cf2a4c2 into sftwrdotdev:master Jul 29, 2026
5 checks passed
@PathGao
PathGao deleted the codex/fix-utf8-fence-slice branch July 29, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markpad 2.6.12 deterministically crashes a few seconds after opening a Markdown file

2 participants