if (temp_short3 == scratch->inline_abbreviations_to_free->size) {
// This is a reference definition
- print_const("<abbr title=\"");
- mmd_print_string_html(out, temp_note->clean_text, false);
- print_const("\">");
- mmd_export_token_tree_html(out, source, t->child, scratch);
- print_const("</abbr>");
+
+ if (temp_short2 == scratch->used_abbreviations->size) {
+ // This is a re-use of a previously used note
+ print_const("<abbr title=\"");
+ mmd_print_string_html(out, temp_note->clean_text, false);
+ print_const("\">");
+ mmd_export_token_tree_html(out, source, t->child, scratch);
+ print_const("</abbr>");
+ } else {
+ // This is the first time this note was used
+ mmd_print_string_html(out, temp_note->clean_text, false);
+ print_const(" (<abbr title=\"");
+ mmd_print_string_html(out, temp_note->clean_text, false);
+ print_const("\">");
+ mmd_export_token_tree_html(out, source, t->child, scratch);
+ print_const("</abbr>)");
+ }
} else {
- // This is an inline definition
- print_const("<abbr title=\"");
+ // This is an inline definition (and therefore the first use)
+ mmd_print_string_html(out, temp_note->clean_text, false);
+ print_const(" (<abbr title=\"");
mmd_print_string_html(out, temp_note->clean_text, false);
print_const("\">");
mmd_print_string_html(out, temp_note->label_text, false);
- print_const("</abbr>");
+ print_const("</abbr>)");
}
} else {
// Note-based syntax disabled
case BRACE_DOUBLE_RIGHT:
print_const("}}");
break;
+ case BRACKET_ABBREVIATION_LEFT:
+ print_const("[>");
+ break;
case BRACKET_CITATION_LEFT:
print_const("[#");
+ break;
case BRACKET_LEFT:
print_const("[");
break;
if (temp_short3 == scratch->inline_abbreviations_to_free->size) {
// This is a reference definition
+ mmd_print_string_odf(out, temp_note->clean_text);
+ print_const(" (");
mmd_print_string_odf(out, temp_note->label_text);
- printf("<text:note text:id=\"gn%d\" text:note-class=\"glossary\"><text:note-body>", temp_short);
- mmd_export_token_tree_odf(out, source, temp_note->content, scratch);
- print_const("</text:note-body></text:note>");
+ print_const(")");
} else {
// This is an inline definition
- mmd_print_string_odf(out, temp_note->label_text);
- printf("<text:note text:id=\"gn%d\" text:note-class=\"glossary\"><text:note-body>", temp_short);
mmd_export_token_tree_odf(out, source, temp_note->content, scratch);
- print_const("</text:note-body></text:note>");
+ print_const(" (");
+ mmd_print_string_odf(out, temp_note->label_text);
+ print_const(")");
}
scratch->odf_para_type = temp_short2;