fix undefined language
This commit is contained in:
parent
94f00053d7
commit
fc2e5b6fb9
2 changed files with 2 additions and 2 deletions
|
|
@ -75,7 +75,7 @@ docsify serve docs
|
|||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/buble.css">
|
||||
```
|
||||
|
||||
### 压缩版
|
||||
压缩版
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
||||
|
|
|
|||
|
|
@ -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>`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue