How to export html without ID

Matt's Avatar


27 Mar, 2012 03:29 PM

How can I have Marked export HTML without ID attributes for each tag? One of the CMS' I am forced to use does not like the ID in the generated content.

  1. Support Staff 1 Posted by Brett on 27 Mar, 2012 03:54 PM

    Brett's Avatar

    This is an option in version 1.4, which I hope to have released this week. I currently use a script in post to strip out the id's based on a regex. If that's an option for you, I'm happy to share something until the new version is approved.

  2. 2 Posted by Matt Williams on 27 Mar, 2012 05:27 PM

    Matt Williams's Avatar

    That would be a great interim solution, thanks.

    Matt Williams
    [email blocked]
    Sent with Sparrow (

  3. Support Staff 3 Posted by Brett on 27 Mar, 2012 10:18 PM

    Brett's Avatar

    If you save the attached file as stripids.rb in whatever script folder (or other) folder you have, you can make it executable by running:

     chmod a+x /pathto/yourfolder/stripids.rb

    Then you can take your output HTML file, and on the command line run:

     cat yourfile.html | /pathto/yourfolder/stripids.rb > newfile.html

    That will give you the same HTML but without the ids on the headers.

    If you need something more OS X-friendly, like a System Service, just let me know. I did wrap up testing and put together a final build of the new version of Marked today (the one that does this automatically). I just need to get some other materials ready and get it approved :).

  4. 4 Posted by Matt on 28 Mar, 2012 03:56 PM

    Matt's Avatar

    Thanks. I'll try it out.

    Sent from my iPhone

  5. Brett closed this discussion on 29 Mar, 2012 04:13 AM.

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