fix(embed): compatible ssr

This commit is contained in:
qingwei.li 2018-02-12 16:19:04 +08:00 committed by cinwell.li
commit dc0c3ced4e
3 changed files with 42 additions and 19 deletions

View file

@ -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