Skip to content

Commit

Permalink
Merge pull request #20 from ruoxuwu/gh-pages
Browse files Browse the repository at this point in the history
Add html and xml support and add case insensitive
  • Loading branch information
chunpu authored Oct 16, 2017
2 parents 2e5a3c2 + 1fee938 commit ee15eef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ var rawRenderer = marked.Renderer

var langArr = 'actionscript3 bash csharp coldfusion cpp css delphi diff erlang groovy java javafx javascript perl php none powershell python ruby scala sql vb html/xml'.split(/\s+/)
var langMap = {
shell: 'bash'
shell: 'bash',
html: 'html',
xml: 'xml'
}
for (var i = 0, x; x = langArr[i++];) {
langMap[x] = x
Expand Down Expand Up @@ -89,7 +91,10 @@ _.extend(Renderer.prototype, rawRenderer.prototype, {
}
, code: function(code, lang) {
// {code:language=java|borderStyle=solid|theme=RDark|linenumbers=true|collapse=true}
lang = langMap[lang] || ''
if(lang) {
lang = lang.toLowerCase()
}
lang = langMap[lang] || 'none'
var param = {
language: lang,
borderStyle: 'solid',
Expand Down

0 comments on commit ee15eef

Please sign in to comment.