-
-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Filed by Claude on behalf of @silverwind
Description
H025 produces a false positive when an HTML attribute contains a Go template expression ({{...}}) that spans multiple lines and includes quoted strings. The inner " characters are misinterpreted as closing the HTML attribute value, causing the opening tag to not be recognized by the H025 tag scanner.
Minimal reproduction
Fails (multiline template expression with inner quotes):
<div>
<div data-x="{{Func
"a"}}"></div>
</div>H025 4:0 Tag seems to be an orphan. </div>
Works (same template expression on a single line):
<div>
<div data-x="{{Func "a"}}"></div>
</div>Root cause
The attribute pattern regex uses {{.*?}} to match template expressions inside attribute values. On a single line this works because .*? matches everything between {{ and }}. But when the expression spans multiple lines and contains " characters, the regex engine appears to interpret the inner " as closing the HTML attribute's double-quote delimiter before the {{.*?}} pattern can consume the full expression.
Environment
- djlint 1.36.4
- Profile:
golang