Skip to content

fix(embed): fix multiple embeds (#1078) #1324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/render/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ export function prerenderEmbed({ compiler, raw = '', fetch }, done) {
.concat(embedToken, tokens.slice(index + 1));
moves.push({ start: index, length: embedToken.length - 1 });
} else {
const cloned = tokens.concat();
cached[raw] = tokens.concat();
tokens.links = cached[raw].links = links;
done(tokens);
tokens.links = cloned.links = cached[raw].links = links;
done(cloned);
Comment on lines +149 to +152
Copy link
Author

@madhavarshney madhavarshney Aug 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO all this cloning here is a bit odd... 😄

}
});
}