Skip to content

Commit

Permalink
fix: use copy of cached value (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-kang authored and QingWei-Li committed Nov 1, 2018
1 parent 2edf47e commit 5fcf210
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/render/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ function walkFetchEmbed({embedTokens, compile, fetch}, cb) {
}

export function prerenderEmbed({compiler, raw = '', fetch}, done) {
let hit
if ((hit = cached[raw])) {
return done(hit)
let hit = cached[raw]
if (hit) {
const copy = hit.slice()
copy.links = hit.links
return done(copy)
}

const compile = compiler._marked
Expand Down

0 comments on commit 5fcf210

Please sign in to comment.