store_asset(scratch, m->value);
asset * a = extract_asset(scratch, m->value);
+ mmd_print_string_html(out, "assets/", false);
mmd_print_string_html(out, a->asset_path, false);
} else {
mmd_print_string_html(out, m->value, false);
fprintf(stderr, "Error adding assets directory to zip.\n");
}
- // Add html version document
- len = strlen(body);
- status = mz_zip_writer_add_mem(&zip, "text.html", body, len, MZ_BEST_COMPRESSION);
+ // Add main document
+ len = e->dstr->currentStringLength;
+ status = mz_zip_writer_add_mem(&zip, "text.md", e->dstr->str, len, MZ_BEST_COMPRESSION);
if (!status) {
fprintf(stderr, "Error adding content to zip.\n");
}
break;
case FORMAT_EPUB:
case FORMAT_TEXTBUNDLE_COMPRESSED:
- mmd_start_complete_html(out, e->dstr->str, scratch);
scratch->store_assets = true;
+ mmd_start_complete_html(out, e->dstr->str, scratch);
+
mmd_export_token_tree_html(out, e->dstr->str, e->root, scratch);
mmd_export_footnote_list_html(out, e->dstr->str, scratch);
mmd_export_glossary_list_html(out, e->dstr->str, scratch);