From: Fletcher T. Penney Date: Wed, 15 Mar 2017 03:41:14 +0000 (-0400) Subject: FIXED: Fix bug with leading spaces in abbreviation references X-Git-Tag: 6.0.0-rc1^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ea87af748f597e700b19ce2d989b8b051cce5c3;p=multimarkdown FIXED: Fix bug with leading spaces in abbreviation references --- diff --git a/Sources/libMultiMarkdown/writer.c b/Sources/libMultiMarkdown/writer.c index 895a4f4..d547eb5 100644 --- a/Sources/libMultiMarkdown/writer.c +++ b/Sources/libMultiMarkdown/writer.c @@ -1267,8 +1267,12 @@ void process_definition_block(mmd_engine * e, token * block) { case BLOCK_DEF_ABBREVIATION: // Strip leading '>'' from term f = footnote_new(e->dstr->str, label, block->child, false); - if (f && f->clean_text) + if (f && f->clean_text) { memmove(f->clean_text, &(f->clean_text)[1],strlen(f->clean_text)); + while (char_is_whitespace((f->clean_text)[0])) { + memmove(f->clean_text, &(f->clean_text)[1],strlen(f->clean_text)); + } + } // Adjust the properties free(f->label_text);