X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fparser.c;h=362a9084bb4833803622f7499380b500b23ccc51;hb=34a97f52caaeab111699e943303039c96c168b96;hp=5ca7ea26a211c2fc223a23a7706bb59e6a31303d;hpb=680d0478fc66d6d25b1f258be0114d6c915ec0a0;p=smdp.git diff --git a/src/parser.c b/src/parser.c index 5ca7ea2..362a908 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) 2014 Michael Goehler + * Copyright (C) 2015 Michael Goehler * * This file is part of mdp. * @@ -191,6 +191,30 @@ deck_t *markdown_load(FILE *input) { slide = deck->slide; while(slide) { line = slide->line; + + // ignore mdpress format attributes + if(line && + slide->lines > 1 && + !CHECK_BIT(line->bits, IS_EMPTY) && + line->text->value[line->offset] == L'=' && + line->text->value[line->offset + 1] == L' ') { + + // remove line from linked list + slide->line = line->next; + line->next->prev = NULL; + + // maintain loop condition + tmp = line; + line = line->next; + + // adjust line count + slide->lines -= 1; + + // delete line + (tmp->text->delete)(tmp->text); + free(tmp); + } + while(line) { // combine underlined H1/H2 in single line if((CHECK_BIT(line->bits, IS_H1) ||