evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

Don't you mean a Markdown parser to HTML in javascript? #177

Closed Capaverde closed 10 years ago

Capaverde commented 10 years ago

I think you should be clear about that for "da noobs".

Btw, I'm thinking of using it for my site, this looks like its pretty popular and functional, good job!

ashb commented 10 years ago

We're always happy to clear things up - but what you take it to mean instead?

Capaverde commented 10 years ago

An actual Markdown to javascript code maybe? As in DOM manipulation.

evilstreak commented 10 years ago

We go through two intermediate representations before turning it into HTML. Both are JsonML; the first represents the structure of the input Markdown, the second is the structure of the HTML.

If you wanted to produce a DOM representation you could use that second JsonML tree to build it pretty easily. That said, it would probably be easier to just assign the HTML output as innerHTML for something and let the browser work out how to build the DOM.