Skip to content

fix: return an error for unterminated template comments - #239

Merged
paganotoni merged 1 commit into
gobuffalo:mainfrom
Mido-sys:fix-unterminated-comment
Oct 31, 2026
Merged

paganotoni merged 1 commit into
gobuffalo:mainfrom
Mido-sys:fix-unterminated-comment

Conversation

@Mido-sys

@Mido-sys Mido-sys commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

fixes #238

Templates containing <%# without a closing %> previously caused the parser to loop indefinitely, hanging rendering and consuming CPU.

The comment parser now stops at EOF and returns line N: unterminated comment, where N identifies the line at EOF.

Tests

Added regression coverage for:

  • Empty and non-empty unterminated comments.
  • Incomplete closing tags, multiline comments, and trailing newlines.
  • Comments after HTML, inside code, and following a closed comment.
  • Render error propagation and interpreter/VM error parity.

@Mido-sys

Copy link
Copy Markdown
Collaborator Author

@paganotoni kindly review

@paganotoni
paganotoni merged commit 99c2508 into gobuffalo:main Oct 31, 2026
7 checks passed
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.

bug: Unterminated template comment causes infinite loop during parsing

2 participants