Metadata stripped when exporting HTML with default stylesheet

btoone's Avatar

btoone

Aug 23, 2015 @ 03:07 PM

When I export to HTML my metadata is stripped if I check the box to "Include preview template in output". However if I don't check that box on export then my metadata appears as expected.

  1. Support Staff 1 Posted by Brett on Aug 23, 2015 @ 04:20 PM

    Brett's Avatar

    Is there any chance you have "Strip MMD Headers" checked in Advanced
    preferences? Even if it's not, try toggling it, saving preferences, and
    toggling it back off.

  2. 2 Posted by btoone on Aug 23, 2015 @ 04:59 PM

    btoone's Avatar

    I do not have that set. I tried toggling it on and off and still get the same result. Exporting without style selected results in the metadata being present. Adding the style removes them.

    Side-note: When I selected the "Strip MMD Headers" and applied, the meta tags remained when I exported without the style selected so it appears to have had no effect.

  3. Support Staff 3 Posted by Brett on Aug 23, 2015 @ 05:09 PM

    Brett's Avatar

    It's a bit misleading as far as export goes, most metadata is still
    processed when exporting. Can you show me a document that has the issue
    in question?

    -Brett

  4. 4 Posted by btoone on Aug 23, 2015 @ 05:25 PM

    btoone's Avatar

    Sure, see attached. Includes md source file and two exports. One where the option is check and the other does not.

  5. Support Staff 5 Posted by Brett on Aug 23, 2015 @ 06:44 PM

    Brett's Avatar

    Ah, figured it out. When Marked includes the CSS in the export, it has
    to use its own wrapping HTML and document structure. Thus, it renders
    MultiMarkdown using the "snippet" setting, which doesn't return the
    <HEAD> contents. Metadata values used in the document itself ([%title])
    are still recognized, but the values won't be in the metadata keys in
    the output's HEAD.

    -Brett

  6. 6 Posted by btoone on Aug 23, 2015 @ 07:15 PM

    btoone's Avatar

    I've tried adding 'format: full' bc I thought it might be working with a snippet but that doesn't seem to help. So is there a solution to this?

  7. Support Staff 7 Posted by Brett on Aug 23, 2015 @ 07:23 PM

    Brett's Avatar

    No, it's a necessary part of generating HTML with a template. If you
    need the metadata, you'll need to export without the template and apply
    your own CSS. Note that you can use "CSS" as a metadata key to have a
    css link included via MMD.

    -Brett

  8. 8 Posted by btoone on Aug 23, 2015 @ 07:39 PM

    btoone's Avatar

    Yep that's the workaround I've been using and it works fine. Thanks

Reply to this discussion

Internal reply

        Formatting help / Preview (switch to plain text)

          You can attach files up to 10MB

            If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

              Keyboard shortcuts

              Generic

              ? Show this help
              ESC Blurs the current field

              Comment Form

              r Focus the comment reply box
              ^ + ↩ Submit the comment

              You can use Command ⌘ instead of Control ^ on Mac