diff --git a/html/token.go b/html/token.go index b426ae07..ae0d1b05 100644 --- a/html/token.go +++ b/html/token.go @@ -347,6 +347,7 @@ loop: break loop } if c != '/' { + z.raw.end-- continue loop } if z.readRawEndTag() || z.err != nil { diff --git a/html/token_test.go b/html/token_test.go index f2473ba6..d59c3c63 100644 --- a/html/token_test.go +++ b/html/token_test.go @@ -258,6 +258,11 @@ var tokenTests = []tokenTest{ "<b>K&R C</b>", "$<b>K&R C</b>$", }, + { + "title with trailing '<' entity", + "foobar<", + "$foobar<$", + }, // DOCTYPE tests. { "Proper DOCTYPE",