Skip to content

Commit

Permalink
fix(content): handle empty lang (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Feb 10, 2021
1 parent 2037ee8 commit 60e758c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/content/parsers/markdown/handlers/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ require('prismjs/plugins/diff-highlight/prism-diff-highlight')
const DIFF_HIGHLIGHT_SYNTAX = /^(diff)-([\w-]+)/i

const prismHighlighter = (rawCode, language, { lineHighlights, fileName }, { h, node }) => {
let lang = language
let lang = language || ''
let grammer

const diffLanguage = language.match(DIFF_HIGHLIGHT_SYNTAX)
const diffLanguage = lang.match(DIFF_HIGHLIGHT_SYNTAX)
if (diffLanguage) {
lang = diffLanguage[2]
grammer = Prism.languages.diff
Expand Down

0 comments on commit 60e758c

Please sign in to comment.