pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
version bump
[smdp.git]
/
src
/
parser.c
diff --git
a/src/parser.c
b/src/parser.c
index
f0d4ed3
..
eb50016
100644
(file)
--- 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.
* 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) 201
5
Michael Goehler
+ * Copyright (C) 201
6
Michael Goehler
*
* This file is part of mdp.
*
*
* This file is part of mdp.
*
@@
-89,7
+89,8
@@
deck_t *markdown_load(FILE *input) {
slide = next_slide(slide);
sc++;
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);
// 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);
// 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;
}
return bits;
}
@@
-600,7
+606,7
@@
void markdown_debug(deck_t *deck, int debug) {
void adjust_line_length(line_t *line) {
int l = 0;
const static wchar_t *special = L"\\*_`"; // list of interpreted chars
void adjust_line_length(line_t *line) {
int l = 0;
const static wchar_t *special = L"\\*_`"; // list of interpreted chars
- const wchar_t *c = &line->text->value[
line->offset
];
+ const wchar_t *c = &line->text->value[
0
];
cstack_t *stack = cstack_init();
// for each char in line
cstack_t *stack = cstack_init();
// for each char in line