Creat github style ID headers

aviram's Avatar

aviram

10 Jan, 2013 08:11 AM

For headers with spaces in them, github puts - character between the words while marked concatinate them without s separator
For example:
a b c d will have an id a-b-c-d in github and abcd in marked, is it possible to have a settings for that ? I really like marked to produce me html as close as github's

  1. Support Staff 1 Posted by Brett on 10 Jan, 2013 01:44 PM

    Brett's Avatar

    This isn't possible with the current MultiMarkdown processor that Marked uses, but you should be able to set up Docter to get exact github output.

    https://github.com/alampros/Docter

    -Brett

  2. 2 Posted by aviram on 10 Jan, 2013 02:30 PM

    aviram's Avatar

    I'll check that out.
    For now I just using github API (that could be a nice feature for Marked for future release)

    Created a script called gfm.sh with

    #!/bin/sh
    /usr/bin/curl -X POST -H "Content-Type: text/x-markdown" --data-binary @- https://api.github.com/markdown/raw
    

    Its a little slower but it works

Reply to this discussion

Internal reply

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

Attaching KB article:

»

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

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