]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix asset path for CSS metadata
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 2 Jul 2017 13:00:30 +0000 (09:00 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 2 Jul 2017 13:00:30 +0000 (09:00 -0400)
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/textbundle.c
Sources/libMultiMarkdown/writer.c

index 8a90a2fb93f3efeab863459e18b81a4efab2dbb1..87a3b4c4f5fa7599759979864ce030496beb257b 100644 (file)
@@ -1848,6 +1848,7 @@ void mmd_start_complete_html(DString * out, const char * source, scratch_pad * s
                                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);
index b89d5b2d62a4361327e42f50fbd02deb6c704200..0874f3daf8bae01eefe725d98b07b53e9cebda5a 100644 (file)
@@ -306,9 +306,9 @@ DString * textbundle_create(const char * body, mmd_engine * e, const char * dire
                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");
        }
index 9bb89088a99e258ff0d8caa629811bd74b59e51b..f0e877d7d00bb8c260247c22c7ebbc9eda9f5278 100644 (file)
@@ -1732,9 +1732,10 @@ void mmd_engine_export_token_tree(DString * out, mmd_engine * e, short format) {
                        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);