Metadata stripped when exporting HTML with default stylesheet
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.
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
Support Staff 1 Posted by Brett on Aug 23, 2015 @ 04:20 PM
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 Posted by btoone on Aug 23, 2015 @ 04:59 PM
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.
Support Staff 3 Posted by Brett on Aug 23, 2015 @ 05:09 PM
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 Posted by btoone on Aug 23, 2015 @ 05:25 PM
Sure, see attached. Includes md source file and two exports. One where the option is check and the other does not.
Support Staff 5 Posted by Brett on Aug 23, 2015 @ 06:44 PM
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 Posted by btoone on Aug 23, 2015 @ 07:15 PM
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?
Support Staff 7 Posted by Brett on Aug 23, 2015 @ 07:23 PM
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 Posted by btoone on Aug 23, 2015 @ 07:39 PM
Yep that's the workaround I've been using and it works fine. Thanks