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

Fix for uncaught errors when 'commandLine' is an empty object. #1862

Merged
merged 6 commits into from
Apr 27, 2019

Conversation

libantema
Copy link
Contributor

No description provided.

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.

Thank you for providing this fix!

I left you a comment for with a minor improvement. (Don't forget to rebuild Prism.)
Also, why did package-lock.json change?

plugins/command-line/prism-command-line.js Outdated Show resolved Hide resolved
plugins/command-line/prism-command-line.js Outdated Show resolved Hide resolved
@RunDevelopment
Copy link
Member

For other reviewers:

This bug is most likely caused by this line in Core.
Because the before-highlight hook is not run before complete, env.vars['command-line'] is undefined.

@libantema
Copy link
Contributor Author

Thank you for providing this fix!

I left you a comment for with a minor improvement. (Don't forget to rebuild Prism.)
Also, why did package-lock.json change?

I like your suggestions, I will commit the changes. Thanks!
I did rebuild Prism using gulp. I'm not sure why package-lock.json changed - it was simply altered after running gulp in my enviro.

RunDevelopment and others added 4 commits April 22, 2019 08:19
More gracefully handle an undefined variable.

Co-Authored-By: libantema <39926488+libantema@users.noreply.github.com>
More gracefully handle an undefined variable.

Co-Authored-By: libantema <39926488+libantema@users.noreply.github.com>
@RunDevelopment
Copy link
Member

@libantema Sorry for the delay!

For now, it's probably the best idea to just revert the changes to package-lock.json, so we can merge this fix.

@RunDevelopment RunDevelopment merged commit c24831b into PrismJS:master Apr 27, 2019
@RunDevelopment
Copy link
Member

Thank you very much for contributing!

@libantema libantema deleted the fix-NaN-bug branch April 27, 2019 19:28
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

2 participants