Skip to content

make formatting of unterminated interpolations idempotent - #261

Merged
g-plane merged 1 commit into
g-plane:mainfrom
UnknownPlatypus:fix-unterminated-interpolation
Sep 21, 2026
Merged

g-plane merged 1 commit into
g-plane:mainfrom
UnknownPlatypus:fix-unterminated-interpolation

Conversation

@UnknownPlatypus

Copy link
Copy Markdown
Contributor

An interpolation running to EOF was recovered by taking the rest of the source as its expression, closed with a }}.

Since the expression scanner matches braces and quotes, any unbalanced opener left in the content swallowed one of those braces on the next parse, which appended another one.

{{{ became {{ { }} then {{ { } }}, growing on every pass.

Unterminated interpolations are now a syntax error, like the unclosed tags and Angular block parameters already are.

  • 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 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for markup-fmt ready!

Name Link
🔨 Latest commit 754f588
🔍 Latest deploy log https://app.netlify.com/projects/markup-fmt/deploys/6ab0ddee19eefa0008ed38ae
😎 Deploy Preview https://deploy-preview-261--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.

@UnknownPlatypus
UnknownPlatypus deleted the fix-unterminated-interpolation branch August 30, 2026 16:42
@UnknownPlatypus
UnknownPlatypus restored the fix-unterminated-interpolation branch August 31, 2026 20:01
Comment thread markup_fmt/src/parser.rs Outdated
Comment thread markup_fmt/tests/fmt.rs Outdated
@UnknownPlatypus
UnknownPlatypus force-pushed the fix-unterminated-interpolation branch from 2205530 to 25919f6 Compare September 21, 2026 07:30
An interpolation running to EOF was recovered by taking the rest of the source
as its expression, then printed with a closing `}}`. Since the expression
scanner matches braces and quotes, the unbalanced opener left in the content
swallowed one of those braces on the next parse, which appended another one:
`{{{` became `{{ { }}`, then `{{ { } }}`, growing on every pass.

Unterminated interpolations are now a syntax error, like the unclosed tags and
Angular block parameters already are.
@UnknownPlatypus
UnknownPlatypus force-pushed the fix-unterminated-interpolation branch from 25919f6 to 754f588 Compare September 21, 2026 07:34
@g-plane
g-plane merged commit fedbeb8 into g-plane:main Sep 21, 2026
5 checks passed
@UnknownPlatypus
UnknownPlatypus deleted the fix-unterminated-interpolation branch September 21, 2026 21:17
@disrupted disrupted mentioned this pull request Sep 24, 2026
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