Skip to content
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.

Commit

Permalink
Support html code lang
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Aug 15, 2012
1 parent 81d8ffe commit bb2c053
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/namp.js
Expand Up @@ -643,11 +643,13 @@ function tok() {
if (!token.escaped)
token.text = escape(token.text, true);
}
else if (token.lang && token.lang !== "no-highlight")
else if (token.lang && token.lang !== "no-highlight") {
token.lang = token.lang === "html" ? "xml" : token.lang;
token.text = hljs.highlight(token.lang, token.text).value;
}
else if (!token.lang)
token.text = hljs.highlightAuto(token.text).value;
// intentionally skip 'no-highlight'
// intentionally skip 'no-highlight'

return '<pre><code'
+ (token.lang
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name" : "namp",
"version" : "0.2.8",
"version" : "0.2.9",
"description" : "Markdown parser for Node, with Maruku, GFM, and PHP Extras support, plus more.",
"keywords" : [ "markdown", "maruku", "gfm", "text processing", "ast" ],
"maintainers" : [
Expand Down

0 comments on commit bb2c053

Please sign in to comment.