diff --git a/format/xml/html.go b/format/xml/html.go index 2bb222ac..4193f0d6 100644 --- a/format/xml/html.go +++ b/format/xml/html.go @@ -196,7 +196,7 @@ func fromHTMLToArray(n *html.Node) any { return f(n) } -var htmlMagicRe = &lazyre.RE{S: `` + +var htmlMagicRE = &lazyre.RE{S: `` + `^` + // anchor to start `(?i)` + // case insensitive `[[:graph:][:space:]]{0,64}?` + // 0-64 non-control ASCII lazily to allow comment etc @@ -214,7 +214,7 @@ func decodeHTML(d *decode.D) any { if d.ArgAs(&pi) { // if probing the input has to start with " or found") } }