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

Markup: Added support for DOM event attributes #2702

Merged
merged 3 commits into from Mar 5, 2021

Conversation

RunDevelopment
Copy link
Member

This resolves #2700.


This is implemented via a new addAttribute function. It works similar to the addInline function and is also part of Markup. Right now, only CSS and JS use it.

JSX had to be changed because the special attributes collided with JSX' script token.

@github-actions
Copy link

github-actions bot commented Jan 6, 2021

JS File Size Changes (gzipped)

A total of 4 files have changed, with a combined diff of +146 B (+3.8%).

file master pull size diff % diff
components/prism-css.min.js 707 B 573 B -134 B -19.0%
components/prism-javascript.min.js 1.31 KB 1.45 KB +141 B +10.7%
components/prism-jsx.min.js 950 B 957 B +7 B +0.7%
components/prism-markup.min.js 897 B 1.03 KB +132 B +14.7%

Generated by 🚫 dangerJS against 608e046

@RunDevelopment
Copy link
Member Author

Looking at the file size, it seems like the logic transfer from CSS to Markup worked well. The gain comes from the list of DOM event attributes in JS.

@RunDevelopment RunDevelopment merged commit 8dbbbb3 into PrismJS:master Mar 5, 2021
@RunDevelopment RunDevelopment deleted the html-event-attributes branch March 5, 2021 22:38
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.

Feature request : Add Highlights for inline javascript into html tags under event-attributes
1 participant