summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown/parser/block.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-03-12 19:41:07 +0100
committerGitHub <noreply@github.com>2022-03-12 19:41:07 +0100
commitb3be2e208cb373207d6199cac5a9fc92be073e7a (patch)
tree6de6d444737edee8f0476eea87c233fa980f0002 /vendor/github.com/gomarkdown/markdown/parser/block.go
parentc30e90ff3f7e9ff96ac79ed4b7d90d6346216a15 (diff)
downloadmatterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.tar.gz
matterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.tar.bz2
matterbridge-msglm-b3be2e208cb373207d6199cac5a9fc92be073e7a.zip
Update dependencies and vendor (#1761)
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/parser/block.go')
-rw-r--r--vendor/github.com/gomarkdown/markdown/parser/block.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/parser/block.go b/vendor/github.com/gomarkdown/markdown/parser/block.go
index 32194d9f..2b48d52d 100644
--- a/vendor/github.com/gomarkdown/markdown/parser/block.go
+++ b/vendor/github.com/gomarkdown/markdown/parser/block.go
@@ -1412,6 +1412,13 @@ gatherlines:
// is this a nested list item?
case (p.uliPrefix(chunk) > 0 && !p.isHRule(chunk)) || p.oliPrefix(chunk) > 0 || p.dliPrefix(chunk) > 0:
+ // if indent is 4 or more spaces on unordered or ordered lists
+ // we need to add leadingWhiteSpaces + 1 spaces in the beginning of the chunk
+ if indentIndex >= 4 && p.dliPrefix(chunk) <= 0 {
+ leadingWhiteSpaces := skipChar(chunk, 0, ' ')
+ chunk = data[ line+indentIndex - (leadingWhiteSpaces + 1) : i]
+ }
+
// to be a nested list, it must be indented more
// if not, it is either a different kind of list
// or the next item in the same list
@@ -1484,7 +1491,7 @@ gatherlines:
}
// add the line into the working buffer without prefix
- raw.Write(data[line+indentIndex : i])
+ raw.Write(chunk)
line = i
}