Skip to content
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

Keep Markup: Restore original nodes instead of clones #3365

Merged
merged 2 commits into from Mar 5, 2022

Conversation

Golmote
Copy link
Contributor

@Golmote Golmote commented Mar 5, 2022

Up until now, the Keep Markup plugin used to clone the markup nodes. This is problematic when you have a reference to a markup node before highlighting: it would be lost after highlighting.

These changes make it so that the plugin keeps the actual original markup nodes in the highlighted output.

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

JS File Size Changes (gzipped)

A total of 1 files have changed, with a combined diff of -5 B (-0.8%).

file master pull size diff % diff
plugins/keep-markup/prism-keep-markup.min.js 666 B 661 B -5 B -0.8%

Generated by 🚫 dangerJS against 7826517

@Golmote
Copy link
Contributor Author

Golmote commented Mar 5, 2022

@RunDevelopment PR updated as per your comments.

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks, @Golmote!

Copy link
Member

@LeaVerou LeaVerou left a comment

Choose a reason for hiding this comment

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

Amazing that all it took was 3 loc! ❤️

@LeaVerou
Copy link
Member

LeaVerou commented Mar 5, 2022

Thank you so much @Golmote!! Can't wait to use this in combination with Mavo to make live demos with code that is editable through selects, ranges etc without having to employ crazy hacks!

@RunDevelopment RunDevelopment merged commit 8a843a1 into PrismJS:master Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants