mirror of
https://github.com/zhigang1992/docsify.git
synced 2026-04-24 05:06:08 +08:00
fix undefined language
This commit is contained in:
@@ -27,7 +27,7 @@ renderer.heading = function (text, level) {
|
||||
}
|
||||
|
||||
// highlight code
|
||||
renderer.code = function (code, lang) {
|
||||
renderer.code = function (code, lang = '') {
|
||||
const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
|
||||
|
||||
return `<pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
|
||||
|
||||
Reference in New Issue
Block a user