Strange issue with XHTML header

Zachary Harmany's Avatar

Zachary Harmany

03 Feb, 2012 08:06 PM

Hey guys, I'm having a strange issue with Marked when I try to use and XHTML header to include MathJax. Basically it skips the first line of my markdown. I've attached a small example where it happens. The strange thing is, if I switch the order of the title and xhtml header, things work just fine! Anyone know if I'm doing something wrong, or if there's a bug in Marked? Thanks!

  1. Support Staff 1 Posted by Brett on 03 Feb, 2012 08:40 PM

    Brett's Avatar

    Marked strips most headers when rendering as they trigger a full document render in MultiMarkdown and that makes it impossible to create valid markup with the results. In this case, it's improperly locating the headers because it also strips out script tags. I might need to switch the order in which it does that. However, MathJax include is a built-in feature of Marked, is there a reason you're including it separately?


  2. 2 Posted by Zachary Harmany on 06 Feb, 2012 06:29 PM

    Zachary Harmany's Avatar

    Thanks for the reply!

    I see, is there anything I could do to make sure it doesn't strip out the first line as well? One reason I have for including the XHTML headers is using my own MathJax installation. This lets me use it without internet access. Also this fork allows equation numbering:


  3. Support Staff 3 Posted by Brett on 06 Feb, 2012 06:50 PM

    Brett's Avatar

    I fixed the first line issue for the version currently in beta. It will be available soon.

    If you turn off the Include MathJax feature in preferences, and then add your own either in XHTML Header: or directly in the body, it *should* be pulled out and added to the end of the rendered document automatically. Until the new version is out, just make sure that you have your headers in the order that doesn't strip the first line. Let me know if there's an issue I'm not aware of and I'll make sure it's fixed in the new version.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • 214 Bytes

Attached Files

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


? 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