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++
|
i++
|
||||||
}
|
}
|
||||||
|
|
||||||
j := i
|
j := 0
|
||||||
for ; i < len(tag); i, j = i+1, j+1 {
|
for ; i < len(tag); i, j = i+1, j+1 {
|
||||||
if j >= len(tagname) {
|
if j >= len(tagname) {
|
||||||
break
|
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) {
|
func TestEmphasis(t *testing.T) {
|
||||||
var tests = []string{
|
var tests = []string{
|
||||||
"nothing inline\n",
|
"nothing inline\n",
|
||||||
|
|
Loading…
Reference in New Issue