Skip to content

Commit

Permalink
fix: docsify-updated is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed May 19, 2017
1 parent a8c73ee commit b2b4742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/fetch/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export function get (url, hasBar = false) {
const result = cache[url] = {
content: target.response,
opt: {
updatedAt: xhr.getResponseHeader('last-modified')
updatedAt: xhr.getResponseHeader('last-modified') ||
xhr.getResponseHeader('expires')
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ export function renderMixin (proto) {
getAndActive('nav')
}

proto._renderMain = function (text, opt) {
proto._renderMain = function (text, opt = {}) {
callHook(this, 'beforeEach', text, result => {
let html = this.isHTML ? result : markdown(result)
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
if (opt.updatedAt) {
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
}

callHook(this, 'afterEach', html, text => renderMain.call(this, text))
})
Expand Down

0 comments on commit b2b4742

Please sign in to comment.