fix: use copy of cached value (#668)

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

View file

@ -57,9 +57,11 @@ function walkFetchEmbed({embedTokens, compile, fetch}, cb) {
} }
export function prerenderEmbed({compiler, raw = '', fetch}, done) { export function prerenderEmbed({compiler, raw = '', fetch}, done) {
let hit let hit = cached[raw]
if ((hit = cached[raw])) { if (hit) {
return done(hit) const copy = hit.slice()
copy.links = hit.links
return done(copy)
} }
const compile = compiler._marked const compile = compiler._marked