diff --git a/generate.c b/generate.c index 448158ad..0c0d2368 100644 --- a/generate.c +++ b/generate.c @@ -430,6 +430,12 @@ linkysize(MMIOT *f, Footnote *ref) c = eatspace(f); if ( (c == ')') || ((c == '\'' || c == '"') && linkytitle(f, c, ref)) ) { + /* add null bytes but pretend they don't exist. */ + EXPAND(height) = 0; + --S(height); + EXPAND(width) = 0; + --S(width); + ref->height = height; ref->width = width; return 1; diff --git a/markdown.c b/markdown.c index 667907ad..bc3ce1be 100644 --- a/markdown.c +++ b/markdown.c @@ -1172,6 +1172,7 @@ addfootnote(Line *p, MMIOT* f) if ( T(p->text)[i] == '}' ) { for ( j++; j < i; j++ ) EXPAND(foot->extended_attr) = T(p->text)[j]; + EXPAND(foot->extended_attr) = 0; j++; } } diff --git a/resource.c b/resource.c index f8802d1f..e5454f25 100644 --- a/resource.c +++ b/resource.c @@ -107,6 +107,7 @@ ___mkd_initmmiot(MMIOT *f, void *footnotes, mkd_flag_t *flags) f->footnotes = footnotes; else { f->footnotes = malloc(sizeof f->footnotes[0]); + f->footnotes->reference = 0; CREATE(f->footnotes->note); } if ( flags )