From 72e3383e758462b99da76777b05d9208cf6ab158 Mon Sep 17 00:00:00 2001 From: maddalax Date: Fri, 11 Oct 2024 11:39:47 -0500 Subject: [PATCH] fix script tag --- tools/html-to-htmgo/internal/domain/node.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/html-to-htmgo/internal/domain/node.go b/tools/html-to-htmgo/internal/domain/node.go index 29464a0..a90e52e 100644 --- a/tools/html-to-htmgo/internal/domain/node.go +++ b/tools/html-to-htmgo/internal/domain/node.go @@ -103,6 +103,17 @@ func (n *CustomNode) String() string { } } + if str == "h.Script(" { + if len(n.Attrs) > 0 { + for _, attr := range n.Attrs { + if attr.key == "h.Src" { + str = str + fmt.Sprintf(`"%s"`, attr.value) + "," + n.Attrs = make([]Attr, 0) + } + } + } + } + booleanAttributes := []string{ "h.AllowFullscreen", "h.Async",