From 278a75ebd5a562fd707e0fe94ae2eb29aaa1e02d Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Thu, 1 Mar 2018 15:27:30 +0100 Subject: [PATCH] fix(render): Disable markdown parsing when the file is an HTML (#403) --- src/core/fetch/index.js | 6 ++++-- src/core/render/index.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js index a7f480321..3361581fc 100644 --- a/src/core/fetch/index.js +++ b/src/core/fetch/index.js @@ -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() diff --git a/src/core/render/index.js b/src/core/render/index.js index 2984af105..1bea205a5 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -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 {