Skip to content

fix: raw block helpers fail to compile with RelaxedHelperNaming enabled - #677

Merged
stencil-harness[bot] merged 1 commit into
masterfrom
claude/issue-676
Nov 7, 2026
Merged

stencil-harness[bot] merged 1 commit into
masterfrom
claude/issue-676

Conversation

@stencil-harness

Copy link
Copy Markdown
Contributor

Problem

With Compatibility.RelaxedHelperNaming = true, no raw block helper compiles. The compiler throws Reached end of template before raw block helper expression 'raw' was closed.

HelperConverter.IsUnregisteredBlockHelperName accepted the closing word of a raw block (for example /raw) and turned it into a block HelperExpression. RawHelperAccumulator then never found the closing tag, so it read to the end of the template and failed. With the default setting, the IsValidHelperLiteral check rejected /raw before it got this far, so the bug only showed up with relaxed naming on.

Fix

IsUnregisteredBlockHelperName now returns false for block-close paths, the same way IsRegisteredHelperName and IsRegisteredBlockHelperName already do. A closing tag can never be the start of a block helper.

Compatibility

Behavior with the default setting is unchanged. The new check only changes the result inside raw tags with RelaxedHelperNaming on, which is the case that was broken.

Tests

  • Added RawHelperTests.RawBlockHelperCompilesRegardlessOfRelaxedHelperNaming. It covers empty raw blocks, raw blocks with a mustache body, nested raw tags, and raw blocks with arguments, each with the setting both off and on. Before the fix the 4 relaxed cases failed.
  • The full suite passes locally: 2193 passed, 0 failed.

Fixes #676

🤖 Generated with Claude Code

Closes #676

…elperNaming

With Compatibility.RelaxedHelperNaming enabled, IsUnregisteredBlockHelperName
accepted the closing word of a raw block (e.g. /raw) and converted it into a
block HelperExpression, so RawHelperAccumulator never found the closing tag and
compilation failed. Reject block-close paths, as the other helper-name checks
already do.

Fixes #676

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

@stencil-harness
stencil-harness Bot merged commit a4a5911 into master Nov 7, 2026
7 checks passed
@stencil-harness
stencil-harness Bot deleted the claude/issue-676 branch November 7, 2026 22:38
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.

Raw block helpers fail to compile when Compatibility.RelaxedHelperNaming is enabled

1 participant