Skip to content

Commit

Permalink
fix for issue #23: don't crash on unrecognized languages
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Herman committed Aug 23, 2012
1 parent 1baf34d commit 1f862fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/codex/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ Project.prototype.parseMarkdown = function (text) {
var lang = token.lang || 'javascript';
if (lang == 'js') lang = 'javascript';
if (lang == 'html') lang = 'xml';
token.text = highlight.highlight(lang, token.text).value;
token.escaped = true;
if (highlight.LANGUAGES.hasOwnProperty(lang)) {
token.text = highlight.highlight(lang, token.text).value;
token.escaped = true;
}
}
}
text = marked.parser(tokens);
Expand Down

0 comments on commit 1f862fa

Please sign in to comment.