From a482cb59f2c9e29c133c4b864cc1e32af1fb99a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 09:50:35 +0000 Subject: [chore]: Bump github.com/yuin/goldmark from 1.6.0 to 1.7.0 (#2603) --- .../github.com/yuin/goldmark/parser/html_block.go | 2 +- vendor/github.com/yuin/goldmark/parser/raw_html.go | 39 +++++++++------------- 2 files changed, 16 insertions(+), 25 deletions(-) (limited to 'vendor/github.com/yuin/goldmark/parser') diff --git a/vendor/github.com/yuin/goldmark/parser/html_block.go b/vendor/github.com/yuin/goldmark/parser/html_block.go index bf0258b5d..09dc21f42 100644 --- a/vendor/github.com/yuin/goldmark/parser/html_block.go +++ b/vendor/github.com/yuin/goldmark/parser/html_block.go @@ -61,8 +61,8 @@ var allowedBlockTags = map[string]bool{ "option": true, "p": true, "param": true, + "search": true, "section": true, - "source": true, "summary": true, "table": true, "tbody": true, diff --git a/vendor/github.com/yuin/goldmark/parser/raw_html.go b/vendor/github.com/yuin/goldmark/parser/raw_html.go index 2b3dbc23d..1d582a7f4 100644 --- a/vendor/github.com/yuin/goldmark/parser/raw_html.go +++ b/vendor/github.com/yuin/goldmark/parser/raw_html.go @@ -58,47 +58,38 @@ var closeProcessingInstruction = []byte("?>") var openCDATA = []byte("") var closeDecl = []byte(">") -var emptyComment = []byte("") -var invalidComment1 = []byte("") -var invalidComment2 = []byte("") +var emptyComment1 = []byte("") +var emptyComment2 = []byte("") var openComment = []byte("") -var doubleHyphen = []byte("--") func (s *rawHTMLParser) parseComment(block text.Reader, pc Context) ast.Node { savedLine, savedSegment := block.Position() node := ast.NewRawHTML() line, segment := block.PeekLine() - if bytes.HasPrefix(line, emptyComment) { - node.Segments.Append(segment.WithStop(segment.Start + len(emptyComment))) - block.Advance(len(emptyComment)) + if bytes.HasPrefix(line, emptyComment1) { + node.Segments.Append(segment.WithStop(segment.Start + len(emptyComment1))) + block.Advance(len(emptyComment1)) return node } - if bytes.HasPrefix(line, invalidComment1) || bytes.HasPrefix(line, invalidComment2) { - return nil + if bytes.HasPrefix(line, emptyComment2) { + node.Segments.Append(segment.WithStop(segment.Start + len(emptyComment2))) + block.Advance(len(emptyComment2)) + return node } offset := len(openComment) line = line[offset:] for { - hindex := bytes.Index(line, doubleHyphen) - if hindex > -1 { - hindex += offset - } - index := bytes.Index(line, closeComment) + offset - if index > -1 && hindex == index { - if index == 0 || len(line) < 2 || line[index-offset-1] != '-' { - node.Segments.Append(segment.WithStop(segment.Start + index + len(closeComment))) - block.Advance(index + len(closeComment)) - return node - } - } - if hindex > 0 { - break + index := bytes.Index(line, closeComment) + if index > -1 { + node.Segments.Append(segment.WithStop(segment.Start + offset + index + len(closeComment))) + block.Advance(offset + index + len(closeComment)) + return node } + offset = 0 node.Segments.Append(segment) block.AdvanceLine() line, segment = block.PeekLine() - offset = 0 if line == nil { break } -- cgit v1.3