Skip to content

[Milestone A] A-02: Fix self-closing tag regex for > in attribute values #78

@csharpfritz

Description

@csharpfritz

Milestone A — Parser Hardening (A-02)

Priority: P0 — Foundation
Size: Medium
Branch: experiment/aspx-middleware
File: src/BlazorWebFormsComponents.AspxMiddleware/AspxParser.cs (~line 326)

Problem

The \SelfClosingAspTagRegex\ uses a greedy match that terminates at the first >\ character, even when it appears inside a quoted attribute value. This breaks parsing of data-binding expressions (<%# Items.Count > 0 %>) and HTML comment-wrapped expressions.

Approach

Replace the regex with a stateful character-by-character attribute parser that tracks quote depth. When inside a quoted attribute value, >\ must not be treated as a tag boundary.

Acceptance Criteria

  • Tags with >\ in quoted attribute values parse correctly
  • Data-binding expressions with comparison operators are preserved
  • HTML comment-wrapped expressions parse correctly
  • All ~52 existing tests still pass

Context

See: \dev-docs/milestones/ASPX-MIDDLEWARE-MILESTONES.md\ § Milestone A
See: \dev-docs/aspx-middleware-migration-landscape.md\ §4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:cyclopsAssigned to Cyclops (Component Dev)squad:rogueAssigned to Rogue (QA Analyst)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions