Fix footnote parsing
Consecutive footnotes do not need to be surrounded by blank lines, courtesy of @microjo. For example, this is now possible: [^1]: footnote1 [^2]: footnote2
This commit is contained in:
parent
d3aaea3300
commit
71af174519
1 changed files with 3 additions and 9 deletions
|
@ -2459,13 +2459,6 @@ is_footnote(const uint8_t *data, size_t beg, size_t end, size_t *last, struct fo
|
|||
i++;
|
||||
if (i >= end || data[i] != ':') return 0;
|
||||
i++;
|
||||
while (i < end && data[i] == ' ') i++;
|
||||
if (i < end && (data[i] == '\n' || data[i] == '\r')) {
|
||||
i++;
|
||||
if (i < end && data[i] == '\n' && data[i - 1] == '\r') i++;
|
||||
}
|
||||
while (i < end && data[i] == ' ') i++;
|
||||
if (i >= end || data[i] == '\n' || data[i] == '\r') return 0;
|
||||
|
||||
/* getting content buffer */
|
||||
contents = bufnew(64);
|
||||
|
@ -2495,8 +2488,9 @@ is_footnote(const uint8_t *data, size_t beg, size_t end, size_t *last, struct fo
|
|||
/* joining only indented stuff after empty lines;
|
||||
* note that now we only require 1 space of indentation
|
||||
* to continue, just like lists */
|
||||
if (in_empty && ind == 0) {
|
||||
break;
|
||||
if (ind == 0) {
|
||||
if (start == id_end + 2 && data[start] == '\t') {}
|
||||
else break;
|
||||
}
|
||||
else if (in_empty) {
|
||||
bufputc(contents, '\n');
|
||||
|
|
Loading…
Reference in a new issue