1
0
mirror of https://github.com/ericchiang/pup synced 2025-07-08 01:18:05 +00:00
This commit is contained in:
rjp 2022-04-01 13:10:19 +00:00 committed by GitHub
commit cd2d9e86eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,9 @@ type Displayer interface {
} }
func ParseDisplayer(cmd string) error { func ParseDisplayer(cmd string) error {
attrRe := regexp.MustCompile(`attr\{([a-zA-Z\-]+)\}`) // Attribute names can be almost anything.
// cf https://www.w3.org/TR/2012/WD-html5-20120329/syntax.html#syntax-attribute-name
attrRe := regexp.MustCompile(`attr\{([^\s"'>/=\p{Cc}]+)\}`)
if cmd == "text{}" { if cmd == "text{}" {
pupDisplayer = TextDisplayer{} pupDisplayer = TextDisplayer{}
} else if cmd == "json{}" { } else if cmd == "json{}" {