diff --git a/block.go b/block.go index b237c7eb..0b5510d4 100644 --- a/block.go +++ b/block.go @@ -664,7 +664,7 @@ func isFenceLine(data []byte, syntax *string, oldmarker string, newlineOptional // If doRender is true, a final newline is mandatory to recognize the fenced code block. func (p *parser) fencedCodeBlock(out *bytes.Buffer, data []byte, doRender bool) int { var syntax string - beg, marker := isFenceLine(data, &syntax, "", true) + beg, marker := isFenceLine(data, &syntax, "", false) if beg == 0 || beg >= len(data) { return 0 } diff --git a/block_test.go b/block_test.go index 6170e56f..62d9a475 100644 --- a/block_test.go +++ b/block_test.go @@ -1661,6 +1661,12 @@ func TestIsFenceLine(t *testing.T) { wantEnd: 4, wantMarker: "```", }, + { + data: []byte("```\nstuff here\n"), + syntaxRequested: true, + wantEnd: 4, + wantMarker: "```", + }, { data: []byte("stuff here\n```\n"), wantEnd: 0,