mirror of
https://github.com/ericchiang/pup
synced 2025-01-15 02:00:55 +00:00
attrRe
is too strict re: attribute names
This commit is contained in:
parent
5a57cf1113
commit
5dda97db83
@ -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{}" {
|
||||||
|
Loading…
Reference in New Issue
Block a user