ReviewOS

also looking at this

stacks/stx

fix(conditionals): don't match directive tokens inside HTML tags

#1779
Closed glennmichael123 wants to merge fix/nested-if-endif-matching into main
2 files +90 -0
9 days ago

Problem

A nested reactive @if/ boundaries.

Fix

Directive tokens only ever occur in text content, never inside a <...> tag. Add isInsideTag() and skip tag-interior @if/ in the branch scanner so the signal and conditional passes agree on what is a directive.

Tests

Adds regression tests (two-pass signal→conditionals) for both outer branches, an inner reactive @elseif chain, plus guards that normal server nesting and a directive @else right after a closing tag still work. Existing conditionals + parser + signal suites all green (871 pass / 0 fail); lint + typecheck clean.

Found while building nested owner-vs-share-mode conditionals in a downstream app (ghostanalytics dashboard).

2 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.

@endif
@endif