Skip to content

Commit

Permalink
Merge pull request #12 from wesalvaro/patch-1
Browse files Browse the repository at this point in the history
Allow marking up of other languages.
  • Loading branch information
ebidel committed May 25, 2016
2 parents c7ce4bc + fcf3a01 commit db31f02
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions prism-highlighter.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,18 @@
return code.match(/^\s*</) ? Prism.languages.markup : Prism.languages.javascript;
}

if (lang === 'js' || lang.substr(0, 2) === 'es') {
return Prism.languages.javascript;
} else if (lang === 'css') {
return Prism.languages.css;
} else if (lang === 'c') {
return Prism.languages.clike;
} else {
// The assumption is that you're mostly documenting HTML when in HTML.
return Prism.languages.markup;
if (Prism.languages[lang]) {
return Prism.languages[lang];
}
switch (lang.substr(0, 2)) {
case 'js':
case 'es':
return Prism.languages.javascript;
case 'c':
return Prism.languages.clike;
default:
// The assumption is that you're mostly documenting HTML when in HTML.
return Prism.languages.markup;
}
},

Expand Down

0 comments on commit db31f02

Please sign in to comment.