Skip to content

Markup: Added support for DOM event attributes#2702

Merged
RunDevelopment merged 3 commits intoPrismJS:masterfrom
RunDevelopment:html-event-attributes
Mar 5, 2021
Merged

Markup: Added support for DOM event attributes#2702
RunDevelopment merged 3 commits intoPrismJS:masterfrom
RunDevelopment:html-event-attributes

Conversation

@RunDevelopment
Copy link
Copy Markdown
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
Copy Markdown

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%).

Details
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
Copy Markdown
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