diff options
author | Wim <wim@42.be> | 2021-12-12 00:05:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-12 00:05:15 +0100 |
commit | 3893a035be347a7687a41d2054dd1b274d3a0504 (patch) | |
tree | dfe4a3bf72a0a6356e51bd8fc2e88e9a26e52331 /vendor/github.com/gomarkdown/markdown/parser/block_table.go | |
parent | 658bdd9faa835660ae407331732e9d93d8f6443b (diff) | |
download | matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.tar.gz matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.tar.bz2 matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.zip |
Update dependencies/vendor (#1659)
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/parser/block_table.go')
-rw-r--r-- | vendor/github.com/gomarkdown/markdown/parser/block_table.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/parser/block_table.go b/vendor/github.com/gomarkdown/markdown/parser/block_table.go index f6c06dff..53fbd471 100644 --- a/vendor/github.com/gomarkdown/markdown/parser/block_table.go +++ b/vendor/github.com/gomarkdown/markdown/parser/block_table.go @@ -105,7 +105,7 @@ func (p *Parser) tableFooter(data []byte) bool { } // tableHeaders parses the header. If recognized it will also add a table. -func (p *Parser) tableHeader(data []byte) (size int, columns []ast.CellAlignFlags, table ast.Node) { +func (p *Parser) tableHeader(data []byte, doRender bool) (size int, columns []ast.CellAlignFlags, table ast.Node) { i := 0 colCount := 1 headerIsUnderline := true @@ -236,11 +236,13 @@ func (p *Parser) tableHeader(data []byte) (size int, columns []ast.CellAlignFlag return } - table = &ast.Table{} - p.addBlock(table) - if header != nil { - p.addBlock(&ast.TableHeader{}) - p.tableRow(header, columns, true) + if doRender { + table = &ast.Table{} + p.addBlock(table) + if header != nil { + p.addBlock(&ast.TableHeader{}) + p.tableRow(header, columns, true) + } } size = skipCharN(data, i, '\n', 1) return @@ -255,7 +257,7 @@ Bob | 31 | 555-1234 Alice | 27 | 555-4321 */ func (p *Parser) table(data []byte) int { - i, columns, table := p.tableHeader(data) + i, columns, table := p.tableHeader(data, true) if i == 0 { return 0 } @@ -284,7 +286,7 @@ func (p *Parser) table(data []byte) int { p.tableRow(data[rowStart:i], columns, false) } - if captionContent, id, consumed := p.caption(data[i:], []byte("Table: ")); consumed > 0 { + if captionContent, id, consumed := p.caption(data[i:], []byte(captionTable)); consumed > 0 { caption := &ast.Caption{} p.Inline(caption, captionContent) |