Skip to content

Commit

Permalink
Merge pull request #8 from commenthol/fix-undef-lang
Browse files Browse the repository at this point in the history
fix: console log Unknown language: ""
  • Loading branch information
valeriangalliat committed Mar 5, 2020
2 parents b94a914 + 8efa3c3 commit 7980c36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -10,7 +10,7 @@ const maybe = f => {

// Highlight with given language.
const highlight = (code, lang) =>
maybe(() => hljs.highlight(lang, code, true).value) || ''
maybe(() => hljs.highlight(lang || 'plaintext', code, true).value) || ''

// Highlight with given language or automatically.
const highlightAuto = (code, lang) =>
Expand Down

0 comments on commit 7980c36

Please sign in to comment.