Skip to content

handle unbalanced braces safely in interpolated text - #257

Merged
g-plane merged 1 commit into
g-plane:mainfrom
UnknownPlatypus:fix-interpolated-brace-oob
Sep 6, 2026
Merged

g-plane merged 1 commit into
g-plane:mainfrom
UnknownPlatypus:fix-interpolated-brace-oob

Conversation

@UnknownPlatypus

Copy link
Copy Markdown
Contributor

This fixes 2 edge cases:

  • deep {{ stacks was causing panic
thread 'fmt_snapshot' (211935) panicked at markup_fmt/src/parser.rs:2945:21:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  • a }} with no matching {{ was treated as an interpolation end, slicing out-of-bounds with get_unchecked in release
thread 'fmt_snapshot' (215456) panicked at /home/thibaut/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:703:22:
unsafe precondition(s) violated: str::get_unchecked requires that the range is within the string slice

This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.

AI policy

  • The pull request description was written manually by me and was not generated by an AI tool or agent.
  • I have read and understood the relevant parts of the existing codebase before making these changes.
  • I have carefully reviewed and understood all code changes, and ensured that they match the style, architecture, and conventions of the existing codebase.
  • I understand that pull requests containing blindly generated or unreviewed AI-generated code may be closed without review.

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for markup-fmt ready!

Name Link
🔨 Latest commit 8db0988
🔍 Latest deploy log https://app.netlify.com/projects/markup-fmt/deploys/6a8e0cc9a367c40008f1f667
😎 Deploy Preview https://deploy-preview-257--markup-fmt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@g-plane
g-plane merged commit 60e46cd into g-plane:main Sep 6, 2026
5 checks passed
@UnknownPlatypus
UnknownPlatypus deleted the fix-interpolated-brace-oob branch September 11, 2026 14:54
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.

2 participants