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

Fixed missed encode call for webworkers #338

Merged
merged 1 commit into from
Aug 21, 2014
Merged

Conversation

planerist
Copy link
Contributor

No description provided.

@LeaVerou
Copy link
Member

Hey, thanks! Could you elaborate why this is needed? (I haven't worked on this part of the code for ages)

@planerist
Copy link
Contributor Author

This bug occurs If you use async highlighting and code contains some html symbols. The obvious example is any C/C++ code "include ", etc.

@LeaVerou
Copy link
Member

Have you tested that the fix works?

@zeitgeist87
Copy link
Collaborator

I would solve this like so:

self.postMessage(_.highlight(code, _.languages[lang], lang));

_.highlight returns a string and includes the call to _.util.encode

You would also have to change the receiving end:

env.highlightedCode = evt.data;

@planerist
Copy link
Contributor Author

Sure, I have tested it and it works fine.

@zeitgeist87
Copy link
Collaborator

This patch also fixes the invalid highlighting on download.html

LeaVerou added a commit that referenced this pull request Aug 21, 2014
Fixed missed encode call for webworkers
@LeaVerou LeaVerou merged commit f3fa64b into PrismJS:gh-pages Aug 21, 2014
@LeaVerou
Copy link
Member

Merged, thanks!

@zeitgeist87 zeitgeist87 mentioned this pull request Aug 21, 2014
@Golmote Golmote mentioned this pull request Dec 13, 2014
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

Successfully merging this pull request may close these issues.

3 participants