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

Highlight Auto breaking on multiple periods #1505

Closed
geekgonecrazy opened this issue Apr 27, 2017 · 5 comments
Closed

Highlight Auto breaking on multiple periods #1505

geekgonecrazy opened this issue Apr 27, 2017 · 5 comments

Comments

@geekgonecrazy
Copy link

geekgonecrazy commented Apr 27, 2017

Running across an odd issue.

If we do: highlightjs.highlightAuto('I ..'); the browser tab completely locks up. We're on the latest version of highlightjs 9.11.0

https://runkit.com/590140aeafa0170012b6169c/590141941ce99600127a433b

A single period seems to work fine. But multiple breaks and if no space before it it also works fine.

Also oddly seems to be a single char space and then multiple periods. If you do multiple letters first its a no go.

<letter>+<space>+..

@isagalaev
Copy link
Member

Thanks for reporting this! Our parser is indeed susceptible to such things if not handled carefully. Fixed.

@geekgonecrazy
Copy link
Author

@isagalaev No problem thanks for the quick fix! 👍

@isagalaev
Copy link
Member

Also, until the next version of highlight.js is released you can either build yourself a copy from master or explicitly list all the language you need for auto highlighting, so the offending language ("gams") is not included.

@rodrigok
Copy link

@isagalaev Are you planing to release the next version soon? Or maybe some alfa version?

This fix is very important to us at Rocket.Chat and we don't want to release a new NPM package just to get this fix in our next version.

Can we help you in some way?

Thanks

@isagalaev
Copy link
Member

Our upcoming release date is Tuesday May, 30 (we do it every 6 weeks). In the meantime you can always build a custom version for yourself from master: http://highlightjs.readthedocs.io/en/latest/building-testing.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants