From 4fd0a7672777f0ed15692ae2ba47838208537558 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 27 Nov 2022 00:42:16 +0100 Subject: Update dependencies (#1929) --- vendor/github.com/gomarkdown/markdown/ast/node.go | 8 ++++++-- vendor/github.com/gomarkdown/markdown/parser/block.go | 10 ++++++++++ vendor/github.com/gomarkdown/markdown/parser/inline.go | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/gomarkdown/markdown') diff --git a/vendor/github.com/gomarkdown/markdown/ast/node.go b/vendor/github.com/gomarkdown/markdown/ast/node.go index e2031193..1d558dd3 100644 --- a/vendor/github.com/gomarkdown/markdown/ast/node.go +++ b/vendor/github.com/gomarkdown/markdown/ast/node.go @@ -157,9 +157,13 @@ func (l *Leaf) GetChildren() []Node { return nil } -// SetChildren will panic becuase Leaf cannot have children +// SetChildren will panic if trying to set non-empty children +// because Leaf cannot have children func (l *Leaf) SetChildren(newChildren []Node) { - panic("leaf node cannot have children") + if len(newChildren) != 0 { + panic("leaf node cannot have children") + } + } // Document represents markdown document node, a root of ast diff --git a/vendor/github.com/gomarkdown/markdown/parser/block.go b/vendor/github.com/gomarkdown/markdown/parser/block.go index eda9be7a..490871c7 100644 --- a/vendor/github.com/gomarkdown/markdown/parser/block.go +++ b/vendor/github.com/gomarkdown/markdown/parser/block.go @@ -1419,6 +1419,16 @@ gatherlines: chunk := data[line+indentIndex : i] + // If there is a fence line (marking starting of a code block) + // without indent do not process it as part of the list. + if p.extensions&FencedCode != 0 { + fenceLineEnd, _ := isFenceLine(chunk, nil, "") + if fenceLineEnd > 0 && indent == 0 { + *flags |= ast.ListItemEndOfList + break gatherlines + } + } + // evaluate how this line fits in switch { // is this a nested list item? diff --git a/vendor/github.com/gomarkdown/markdown/parser/inline.go b/vendor/github.com/gomarkdown/markdown/parser/inline.go index 70d38f29..035d90a0 100644 --- a/vendor/github.com/gomarkdown/markdown/parser/inline.go +++ b/vendor/github.com/gomarkdown/markdown/parser/inline.go @@ -157,6 +157,7 @@ func codeSpan(p *Parser, data []byte, offset int) (int, ast.Node) { } if !IsSpace(data[j]) { hasCharsAfterDelimiter = true + break } } -- cgit v1.2.3