diff --git a/_test/options.txt b/_test/options.txt index 99bc29c..433c49f 100644 --- a/_test/options.txt +++ b/_test/options.txt @@ -60,3 +60,11 @@ //- - - - - - - - -//

Test ## {#hey .sort,class=fine,class=shell} Doesn't matter

//= = = = = = = = = = = = = = = = = = = = = = = =// + + +6: class must be a string +//- - - - - - - - -// +# Test ## {class=0#.} +//- - - - - - - - -// +

Test ## {class=0#.}

+//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/parser/attribute.go b/parser/attribute.go index ea8c064..4c7cc24 100644 --- a/parser/attribute.go +++ b/parser/attribute.go @@ -129,6 +129,11 @@ func parseAttribute(reader text.Reader) (Attribute, bool) { if !ok { return Attribute{}, false } + if bytes.Equal(name, attrNameClass) { + if _, ok = value.([]byte); !ok { + return Attribute{}, false + } + } return Attribute{Name: name, Value: value}, true }