Conversion to HTML, snippet option, how to preserve DOCTYPE and closing body + HTML in transcluded sections?

mpost's Avatar


31 Jul, 2017 08:08 PM

Hello Fletcher,

let me first say that MultiMarkdown is the greatest thing since sliced bread. I’m recommending it to absolutely everyone, I bought MultiMarkdown Composer and I‘d buy the t-shirt, too if there were one. :)

Now here’s a problem I can’t solve on my own (but I realize it may simply not be doable without post-processing). I have a (simplified test) file “” with transclusions like this:

Title: Transclusion test


“” contains:

<!DOCTYPE html>
<meta charset="utf-8">

“” contains:


Now when converting this in snippets mode in MMD 5.4 (as part of Bryan Jones’ CodeKit), the transcluded header’s content comes out as:

<p>&lt;!DOCTYPE html&gt;
<meta charset="utf-8">
<title>Transclusion test</title>

I.e., it is wrapped in <p></p> tags and the DOCTYPE tag gets converted.

For the transcluded footer, closing body and HTML tags get wrapped in paragraph tags, too:


In MultiMarkdown 6.1, the second problem is resolved, but the &lt;!DOCTYPE html&gt; issue remains.

For this particular project, I need to have full control over HTML structure, that’s why I’m using the snippets option.

Any way to avoid this problem – i.e., have MMD preserve the <!DOCTYPE html> and </body></html> tags as such?

Thank you!

  1. Support Staff 1 Posted by fletcher on 31 Jul, 2017 11:02 PM

    fletcher's Avatar

    I'm glad MMD has been helpful for you, and thanks for the support!!

    In v5, you could try using the old raw text syntax, which is to use an html comment -- <!--foo-->.

    But better is to use v6, and use the new syntax for including raw text, as discussed here. You can combine either with transclusion.

    Hope this helps!!!


  2. fletcher closed this discussion on 31 Jul, 2017 11:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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

Recent Discussions

11 Dec, 2022 09:57 PM
11 Dec, 2022 07:57 PM
26 Sep, 2022 02:40 AM
21 Jul, 2022 10:22 AM
11 Jan, 2022 02:33 PM

Recent Articles