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

File Highlight: ie crash #2656

Merged
merged 3 commits into from Nov 24, 2020
Merged

Conversation

dreammaster82
Copy link
Contributor

IE bug with matches in File Highlight

@RunDevelopment
Copy link
Member

Thank you for the fix @dreammaster82!

Please run npm run build and commit all changes to make the CI pass.

@RunDevelopment RunDevelopment merged commit 3f4ae00 into PrismJS:master Nov 24, 2020
@RunDevelopment
Copy link
Member

Thank you for contributing @dreammaster82!

@mAAdhaTTah
Copy link
Member

In general, I don't love modifying the prototypes like this but if MDN is recommending it, this is fine.

Related to #1578.

@RunDevelopment
Copy link
Member

@mAAdhaTTah Btw, we already used this polyfill here before. But I agree that Prism shouldn't modify these prototypes in all other cases.

@joshgoebel
Copy link

Is it necessary to have the polyfill in two places? If Prism.js hooks it up why does the plug-in need to do the same thing?

@RunDevelopment
Copy link
Member

Prism doesn't really do anything for plugins other than to provide hooks. You can mix and match any combination of plugins, so copying the polyfill is the easiest solution, or is there something I'm missing?

@mAAdhaTTah
Copy link
Member

If Prism.js hooks it up why does the plug-in need to do the same thing?

Prism core doesn't. Two separate plugins do.

It is a little annoying that we have the same code twice tho. Maybe it should be in core?

@RunDevelopment
Copy link
Member

Maybe it should be in core?

Should core house a polyfill that is only used by 2 plugins? Maybe.
Should core house the polyfills of all plugins? Definitely no.

Core shouldn't contain any code it doesn't need to run IMO. If we wanted to extract the common logic of plugins, then that logic should be a new plugin (library). We already have examples of this with languages like Markup templating.

@joshgoebel
Copy link

Ah I just saw prism.js in the changes. But I guess for you all that’s a build asset?

@mAAdhaTTah
Copy link
Member

mAAdhaTTah commented Nov 28, 2020

@joshgoebel Yeah, we commit our build assets cuz they power the download page.

@RunDevelopment Makes sense, let's leave it then. It's not a ton of code, and we'll just kill it when we drop IE11 support.

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

4 participants