summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown/parser/block_table.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_table.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_table.go')
-rw-r--r--vendor/github.com/gomarkdown/markdown/parser/block_table.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/parser/block_table.go b/vendor/github.com/gomarkdown/markdown/parser/block_table.go
index 53fbd471..0bf4f4ad 100644
--- a/vendor/github.com/gomarkdown/markdown/parser/block_table.go
+++ b/vendor/github.com/gomarkdown/markdown/parser/block_table.go
@@ -25,6 +25,11 @@ func (p *Parser) tableRow(data []byte, columns []ast.CellAlignFlags, header bool
cellStart := i
+ // If we are in a codespan we should discount any | we see, check for that here and skip ahead.
+ if isCode, _ := codeSpan(p, data[i:], 0); isCode > 0 {
+ i += isCode - 1
+ }
+
for i < n && (data[i] != '|' || isBackslashEscaped(data, i)) && data[i] != '\n' {
i++
}
@@ -84,6 +89,11 @@ func (p *Parser) tableFooter(data []byte) bool {
n := len(data)
i := skipCharN(data, 0, ' ', 3)
for ; i < n && data[i] != '\n'; i++ {
+ // If we are in a codespan we should discount any | we see, check for that here and skip ahead.
+ if isCode, _ := codeSpan(p, data[i:], 0); isCode > 0 {
+ i += isCode - 1
+ }
+
if data[i] == '|' && !isBackslashEscaped(data, i) {
colCount++
continue
@@ -111,6 +121,11 @@ func (p *Parser) tableHeader(data []byte, doRender bool) (size int, columns []as
headerIsUnderline := true
headerIsWithEmptyFields := true
for i = 0; i < len(data) && data[i] != '\n'; i++ {
+ // If we are in a codespan we should discount any | we see, check for that here and skip ahead.
+ if isCode, _ := codeSpan(p, data[i:], 0); isCode > 0 {
+ i += isCode - 1
+ }
+
if data[i] == '|' && !isBackslashEscaped(data, i) {
colCount++
}