diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-06-09 21:09:39 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-06-09 21:09:39 +0200 |
| commit | 6903a774ecbbd05596adda5e2b5e18d58dd3a8f9 (patch) | |
| tree | f5d48f52f0da3da8d829436519bc66652bf41c64 /vendor/github.com/yuin/goldmark/parser/list.go | |
| parent | e75d9e371269a4e46bffa6b3dd1fc7d040e82750 (diff) | |
| download | gofu-6903a774ecbbd05596adda5e2b5e18d58dd3a8f9.tar.gz | |
bump all dependencies to their latest versions
Diffstat (limited to 'vendor/github.com/yuin/goldmark/parser/list.go')
| -rw-r--r-- | vendor/github.com/yuin/goldmark/parser/list.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/vendor/github.com/yuin/goldmark/parser/list.go b/vendor/github.com/yuin/goldmark/parser/list.go index 3e0eea6..ca7040a 100644 --- a/vendor/github.com/yuin/goldmark/parser/list.go +++ b/vendor/github.com/yuin/goldmark/parser/list.go @@ -18,7 +18,7 @@ const ( var skipListParserKey = NewContextKey() var emptyListItemWithBlankLines = NewContextKey() -var listItemFlagValue interface{} = true +var listItemFlagValue any = true // Same as // `^(([ ]*)([\-\*\+]))(\s+.*)?\n?$`.FindSubmatchIndex or @@ -80,14 +80,6 @@ func parseListItem(line []byte) ([6]int, listItemType) { return ret, typ } -func matchesListItem(source []byte, strict bool) ([6]int, listItemType) { - m, typ := parseListItem(source) - if typ != notList && (!strict || strict && m[1] < 4) { - return m, typ - } - return m, notList -} - func calcListOffset(source []byte, match [6]int) int { var offset int if match[4] < 0 || util.IsBlank(source[match[4]:]) { // list item starts with a blank line @@ -132,7 +124,7 @@ func (b *listParser) Open(parent ast.Node, reader text.Reader, pc Context) (ast. return nil, NoChildren } line, _ := reader.PeekLine() - match, typ := matchesListItem(line, true) + match, typ := parseListItem(line) if typ == notList { return nil, NoChildren } @@ -198,7 +190,7 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta if indent < offset || lastIsEmpty { if indent < 4 { - match, typ := matchesListItem(line, false) // may have a leading spaces more than 3 + match, typ := parseListItem(line) if typ != notList && match[1]-offset < 4 { marker := line[match[3]-1] if !list.CanContinue(marker, typ == orderedList) { |
