From bb2c0534e0a61054e52a47bc9f0ded076d374027 Mon Sep 17 00:00:00 2001 From: Garen Torikian Date: Wed, 15 Aug 2012 09:17:05 -0700 Subject: [PATCH] Support html code lang --- lib/namp.js | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/namp.js b/lib/namp.js index e016ac7..23714ac 100644 --- a/lib/namp.js +++ b/lib/namp.js @@ -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 '