]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix bug with leading spaces in abbreviation references
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 15 Mar 2017 03:41:14 +0000 (23:41 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 15 Mar 2017 03:41:14 +0000 (23:41 -0400)
Sources/libMultiMarkdown/writer.c

index 895a4f42a2a89159339a3774dc81b7deea2f0381..d547eb5daa933c34bb4a10c17c142cc3a49606b1 100644 (file)
@@ -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);