mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Fix bug in isHtmlTag()
Fix what seems to be a typo. j should iterate through all tagname, so it should be initialized to zero. The test exposes this bug.
This commit is contained in:
parent
90509d39d4
commit
d5a8df164b
2
html.go
2
html.go
|
@ -663,7 +663,7 @@ func isHtmlTag(tag []byte, tagname string) bool {
|
|||
i++
|
||||
}
|
||||
|
||||
j := i
|
||||
j := 0
|
||||
for ; i < len(tag); i, j = i+1, j+1 {
|
||||
if j >= len(tagname) {
|
||||
break
|
||||
|
|
|
@ -63,6 +63,14 @@ func doTestsInlineParam(t *testing.T, tests []string, extensions, htmlFlags int)
|
|||
}
|
||||
}
|
||||
|
||||
func TestRawHtmlTag(t *testing.T) {
|
||||
tests := []string{
|
||||
"zz <style>p {}</style>\n",
|
||||
"<p>zz p {}</p>\n",
|
||||
}
|
||||
doTestsInlineParam(t, tests, 0, HTML_SKIP_STYLE)
|
||||
}
|
||||
|
||||
func TestEmphasis(t *testing.T) {
|
||||
var tests = []string{
|
||||
"nothing inline\n",
|
||||
|
|
Loading…
Reference in New Issue
Block a user