Skip to content

Commit a1fa953

Browse files
committed
fix(render): Disable markdown parsing when the file is an HTML
1 parent 01bbbaa commit a1fa953

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/core/fetch/index.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ export function fetchMixin (proto) {
2727
// Abort last request
2828
last && last.abort && last.abort()
2929

30-
last = get(this.router.getFile(path) + qs, true, requestHeaders)
30+
const file = this.router.getFile(path)
31+
32+
last = get(file + qs, true, requestHeaders)
3133

3234
// Current page is html
33-
this.isHTML = /\.html$/g.test(path)
35+
this.isHTML = /\.html$/g.test(file)
3436

3537
const loadSideAndNav = () => {
3638
if (!loadSidebar) return cb()
@@ -56,14 +58,14 @@ export function fetchMixin (proto) {
5658

5759
// Load nav
5860
loadNavbar &&
59-
loadNested(
60-
path,
61-
qs,
62-
loadNavbar,
63-
text => this._renderNav(text),
64-
this,
65-
true
66-
)
61+
loadNested(
62+
path,
63+
qs,
64+
loadNavbar,
65+
text => this._renderNav(text),
66+
this,
67+
true
68+
)
6769
}
6870

6971
proto._fetchCover = function () {

src/core/render/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { callHook } from '../init/lifecycle'
66
import { Compiler } from './compiler'
77
import { getAndActive, sticky } from '../event/sidebar'
88
import { getPath, isAbsolutePath } from '../router/util'
9-
import { isMobile, inBrowser } from '../util/env'
9+
import { inBrowser, isMobile } from '../util/env'
1010
import { isPrimitive } from '../util/core'
11-
import { scrollActiveSidebar, scroll2Top } from '../event/scroll'
11+
import { scroll2Top, scrollActiveSidebar } from '../event/scroll'
1212
import { prerenderEmbed } from './embed'
1313

1414
function executeScript () {
@@ -134,8 +134,9 @@ export function renderMixin (proto) {
134134

135135
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
136136
}
137+
137138
if (this.isHTML) {
138-
html = this.result
139+
html = this.result = text
139140
callback()
140141
next()
141142
} else {

0 commit comments

Comments
 (0)