fix(embed): compatible ssr
This commit is contained in:
parent
62ce447fc3
commit
dc0c3ced4e
3 changed files with 42 additions and 19 deletions
|
|
@ -109,7 +109,7 @@ export class Compiler {
|
|||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(this.contentBase, href)
|
||||
href = getPath(process.env.SSR ? '' : this.contentBase, href)
|
||||
}
|
||||
|
||||
let media
|
||||
|
|
@ -182,6 +182,7 @@ export class Compiler {
|
|||
}
|
||||
// highlight code
|
||||
origin.code = renderer.code = function (code, lang = '') {
|
||||
code = code.replace(/@DOCSIFY_QM@/g, '`')
|
||||
const hl = Prism.highlight(
|
||||
code,
|
||||
Prism.languages[lang] || Prism.languages.markup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue