X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fparser.c;h=eb50016874b2e90df59d5cd81f7db8dec1e89355;hb=d697dc5138fe93ed9d0316ddf41de6c12b05683d;hp=cbe46b16727efca36ac3e2d0c169f416dc14563d;hpb=2ee89b63451a530c88ad705d6a99ea19e993f3a5;p=smdp.git diff --git a/src/parser.c b/src/parser.c index cbe46b1..eb50016 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2,7 +2,7 @@ * Functions necessary to parse a file and transform its content into * a deck of slides containing lines. All based on markdown formating * rules. - * Copyright (C) 2015 Michael Goehler + * Copyright (C) 2016 Michael Goehler * * This file is part of mdp. * @@ -89,7 +89,8 @@ deck_t *markdown_load(FILE *input) { slide = next_slide(slide); sc++; - } else if(CHECK_BIT(bits, IS_TILDE_CODE) && CHECK_BIT(bits, IS_EMPTY)) { + } else if(CHECK_BIT(bits, IS_TILDE_CODE) && + CHECK_BIT(bits, IS_EMPTY)) { // remove tilde code markers (text->reset)(text); @@ -339,6 +340,11 @@ int markdown_analyse(cstring_t *text, int prev) { // return IS_EMPTY on null pointers if(!text || !text->value) { SET_BIT(bits, IS_EMPTY); + + // continue fenced code blocks across empty lines + if(num_tilde_characters > 0) + SET_BIT(bits, IS_CODE); + return bits; }