fix(render): Disable markdown parsing when the file is an HTML (#403)
This commit is contained in:
parent
b8a4e6ba1b
commit
278a75ebd5
2 changed files with 5 additions and 3 deletions
|
|
@ -27,10 +27,12 @@ export function fetchMixin (proto) {
|
||||||
// Abort last request
|
// Abort last request
|
||||||
last && last.abort && last.abort()
|
last && last.abort && last.abort()
|
||||||
|
|
||||||
last = get(this.router.getFile(path) + qs, true, requestHeaders)
|
const file = this.router.getFile(path)
|
||||||
|
|
||||||
|
last = get(file + qs, true, requestHeaders)
|
||||||
|
|
||||||
// Current page is html
|
// Current page is html
|
||||||
this.isHTML = /\.html$/g.test(path)
|
this.isHTML = /\.html$/g.test(file)
|
||||||
|
|
||||||
const loadSideAndNav = () => {
|
const loadSideAndNav = () => {
|
||||||
if (!loadSidebar) return cb()
|
if (!loadSidebar) return cb()
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ export function renderMixin (proto) {
|
||||||
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
|
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
|
||||||
}
|
}
|
||||||
if (this.isHTML) {
|
if (this.isHTML) {
|
||||||
html = this.result
|
html = this.result = text
|
||||||
callback()
|
callback()
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue