From 28be4a59c940bd55ed4fef668091d52638925c3c Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 4 Sep 2014 15:55:27 +0200 Subject: 379/62 --- src/blocks.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/blocks.c') diff --git a/src/blocks.c b/src/blocks.c index bd25d6c..cf0e9e4 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -752,11 +752,15 @@ static void incorporate_line(gh_buf *line, int line_number, block** curptr) add_line(container, &input, offset); } else if (container->tag == fenced_code) { + matched = 0; + + if (indent <= 3 && + peek_at(&input, first_nonspace) == container->attributes.fenced_code_data.fence_char) { + int fence_len = scan_close_code_fence(&input, first_nonspace); + if (fence_len > container->attributes.fenced_code_data.fence_length) + matched = 1; + } - matched = (indent <= 3 - && peek_at(&input, first_nonspace) == container->attributes.fenced_code_data.fence_char) - && scan_close_code_fence(&input, first_nonspace, - container->attributes.fenced_code_data.fence_length); if (matched) { // if closing fence, don't add line to container; instead, close it: finalize(container, line_number); -- cgit v1.2.3