fix: use copy of cached value (#668)

This commit is contained in:
程康 2018-11-01 00:04:25 +00:00 committed by cinwell.li
parent 2edf47ec73
commit 5fcf210dd1

View File

@ -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