This is an automated email from the ASF dual-hosted git repository.

LinkinStars pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git

commit ace02c499a0ccf64f05e99185d7e6dcfd4aead06
Author: Xan Torres <[email protected]>
AuthorDate: Wed Aug 19 11:59:30 2026 +0800

    chore: align asset-check comments with the DOM-tolerant parser
    
    The GetStyle comment framed the DOM walk around attribute order,
    attribute set, and quoting, the same properties the old regex parser
    depended on, without stating that the new parser ignores all of
    them. check-built-assets.sh described its self-check as failing when
    asset tags change shape, but the fixtures test a missing script or
    stylesheet tag, and the parser accepts any shape as long as the tag
    is present.
    
    Comments now state the actual constraint: tag shape does not affect
    parsing, and the guarding check fails when a build is present but a
    required script or stylesheet tag is missing from it.
    
    (cherry picked from commit 3bc12e80a659a08dbe72c840a60b25c8c0f90963, 
internal/controller/template_controller.go only)
---
 internal/controller/template_controller.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/internal/controller/template_controller.go 
b/internal/controller/template_controller.go
index 4343738a..0f2f5b68 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -94,11 +94,11 @@ func GetStyle() (script []string, css []string) {
                return
        }
 
-       // The frontend build tool controls attribute order, attribute set (e.g.
-       // module vs classic scripts), and quoting for the emitted tags, and 
that
-       // shape has already changed once. Walk the parsed DOM instead of 
matching
-       // a literal tag shape so the next bundler change fails a test instead 
of
-       // silently shipping pages with no JS or CSS.
+       // Script and stylesheet tags are read from the parsed document, so
+       // attribute order, attribute set (module vs classic scripts), and
+       // quoting do not matter. That shape has already changed once; a
+       // bundler change that breaks it now fails the guarding test instead
+       // of silently shipping pages with no JS or CSS.
        doc, err := html.Parse(bytes.NewReader(file))
        if err != nil {
                return

Reply via email to