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

Normalize Whitespace: Removed unnecessary checks #3017

Merged
merged 1 commit into from Aug 2, 2021

Conversation

RunDevelopment
Copy link
Member

This resolves #3016.

The typeof document === 'undefined' was unnecessary. The plugin does interact with the DOM but only in the before-sanity-check hook which is run inside highlightElement which is given a DOM element. So the plugin only tries to interact with the DOM if it is given a DOM element. Therefore, the check is unnecessary.

I also removed a duplicate typeof Prism === 'undefined' check. No idea why that was there.

@github-actions
Copy link

JS File Size Changes (gzipped)

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

file master pull size diff % diff
plugins/normalize-whitespace/prism-normalize-whitespace.min.js 1.1 KB 1.08 KB -16 B -1.5%

Generated by 🚫 dangerJS against 877af6e

@RunDevelopment RunDevelopment merged commit 63edf14 into PrismJS:master Aug 2, 2021
@RunDevelopment RunDevelopment deleted the issue3016 branch August 2, 2021 14: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.

Unable to require the normalize-whitespace plugin in node
2 participants