From: Fletcher T. Penney Date: Tue, 14 Feb 2017 06:23:45 +0000 (-0500) Subject: FIXED: Properly add id attribute to new instances of citation only X-Git-Tag: 0.3.0a^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7771c794636b22352b667b1bb4e12b0be3df875c;p=multimarkdown FIXED: Properly add id attribute to new instances of citation only --- diff --git a/src/html.c b/src/html.c index c17aa9f..4e89911 100644 --- a/src/html.c +++ b/src/html.c @@ -1039,13 +1039,20 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t } if (scratch->extensions & EXT_NOTES) { + temp_short2 = scratch->used_citations->size; + citation_from_bracket(source, scratch, t, &temp_short); if (temp_bool) { - // This is a new citation - temp_short = scratch->used_citations->size; - printf("[%s%s%d]", - temp_short, temp_short, LC("see citation"), temp_char, temp_char2, temp_short); + if (temp_short2 == scratch->used_citations->size) { + // Repeat of earlier citation + printf("[%s%s%d]", + temp_short, LC("see citation"), temp_char, temp_char2, temp_short); + } else { + // New citation + printf("[%s%s%d]", + temp_short, temp_short, LC("see citation"), temp_char, temp_char2, temp_short); + } } if (t->prev && (t->prev->type == PAIR_BRACKET)) { @@ -1300,11 +1307,11 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t } else { print("\n"); } - if (t->next) - scratch->table_cell_count += t->next->len; - else - scratch->table_cell_count++; - + if (t->next) + scratch->table_cell_count += t->next->len; + else + scratch->table_cell_count++; + break; case TABLE_DIVIDER: break;