From 0a297615e6ea825ded468d85aba546d804d4b5d2 Mon Sep 17 00:00:00 2001 From: Robert Lowry Date: Sun, 20 Jan 2019 12:09:27 -0600 Subject: [PATCH] block.go: set fenceLength (#505) --- block.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.go b/block.go index b860747..37283ee 100644 --- a/block.go +++ b/block.go @@ -673,6 +673,7 @@ func (p *Markdown) fencedCodeBlock(data []byte, doRender bool) int { if beg == 0 || beg >= len(data) { return 0 } + fenceLength := beg - 1 var work bytes.Buffer work.Write([]byte(info)) @@ -706,6 +707,7 @@ func (p *Markdown) fencedCodeBlock(data []byte, doRender bool) int { if doRender { block := p.addBlock(CodeBlock, work.Bytes()) // TODO: get rid of temp buffer block.IsFenced = true + block.FenceLength = fenceLength finalizeCodeBlock(block) }