Skip to content

Commit

Permalink
fix(render): Disable markdown parsing when the file is an HTML (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita authored and QingWei-Li committed Mar 1, 2018
1 parent b8a4e6b commit 278a75e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/core/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ export function fetchMixin (proto) {
// Abort last request
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
this.isHTML = /\.html$/g.test(path)
this.isHTML = /\.html$/g.test(file)

const loadSideAndNav = () => {
if (!loadSidebar) return cb()
Expand Down
2 changes: 1 addition & 1 deletion src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function renderMixin (proto) {
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
}
if (this.isHTML) {
html = this.result
html = this.result = text
callback()
next()
} else {
Expand Down

0 comments on commit 278a75e

Please sign in to comment.