Skip to content

[VBScript Colouring] Nested VBScript Blocks In HTML Code Has Incorrect Colours #7

@ashtonckj

Description

@ashtonckj

Extension Version

v0.3.4

Description

Syntax highlighting breaks when an ASP expression (<%= %>) that contains an HTML tag is used inside an HTML attribute value. This creates an ambiguous structure that confuses the highlighter — HTML inside VBScript inside an HTML attribute.

The two root causes are:

  • The closing > of <br> is interpreted as the closing tag of the outer HTML element
  • The " around "<br>" is interpreted as closing the HTML attribute value early

Current Behaviour

<button type="button" onclick="edtActionItem('<%= Replace(actionItem, vbCrLf, "<br>") %>')">
    <img src="images/edit.png" />
</button>

The highlighting incorrectly treats:

  • <br> → the > is seen as closing the <button tag
  • "<br>" → the opening " is seen as ending the onclick attribute value

Expected Behaviour

The full line should be highlighted as an HTML element with an inline ASP expression. The <br> inside the VBScript string and the %> closing tag should not interfere with the HTML attribute or element parsing.

Addtional Context

Semantic tokens were attempted as a fix but the ambiguity is difficult to resolve at the tokeniser level. This issue is known and is likely best ignored or excluded from scope for now, as a proper fix would require a more context-aware parser.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghtmlHypertext markup language for web pagesvbscriptLegacy scripting for Windows / ASP

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions