Issue #5 : Fixed 'index out of range' error when FilterTags exists

This commit is contained in:
yuin 2019-05-15 17:54:37 +09:00
parent 31fd0f6b4c
commit 4ff89123a4

View file

@ -84,7 +84,7 @@ func (s *rawHTMLParser) parseMultiLineRegexp(reg *regexp.Regexp, block text.Read
}
if m != nil {
if s.FilterTags != nil {
if s.FilterTags != nil && len(m) > 1 {
tagName := string(m[1])
if _, ok := s.FilterTags[tagName]; ok {
return nil