Skip to content

Commit

Permalink
Fixes #219
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed May 16, 2021
1 parent 43353ae commit 38f7fc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _test/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@
//- - - - - - - - -//
<h2 id="test--hey-sortclassfineclassshell-doesnt-matter">Test ## {#hey .sort,class=fine,class=shell} Doesn't matter</h2>
//= = = = = = = = = = = = = = = = = = = = = = = =//


6: class must be a string
//- - - - - - - - -//
# Test ## {class=0#.}
//- - - - - - - - -//
<h1 id="test--class0">Test ## {class=0#.}</h1>
//= = = = = = = = = = = = = = = = = = = = = = = =//
5 changes: 5 additions & 0 deletions parser/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 38f7fc9

Please sign in to comment.