AnantLabs / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

highlight code in webworker #200

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use importScripts() in a WebWorker

I want to highlight scripts, users write down
on a textarea. 
Because it takes longer than 1 second for highlighting
more than 180 lines  of code on my system, I want
to highlight the text in a webworker script.
(AMD Athlon X2 5200+ @2,7ghz, 4gb RAM )

Problem is, the prettify script use 'window'
which is not usable in webworker.

Is there maybe a simple solution to go arround or am I allowed
to modify the script by myself?

Thank you
Thorsten

Original issue reported on code.google.com by t-bon...@gmx.net on 5 Apr 2012 at 10:31

GoogleCodeExporter commented 9 years ago
> Is there maybe a simple solution to go around or am I allowed
> to modify the script by myself?

The code is released under the Apache 2 license ( 
http://www.apache.org/licenses/LICENSE-2.0 ) so feel free to modify it.  If you 
do figure out how to make it webworker compatible, I'd love to see the result, 
but it does depend on document and window in various places.

Original comment by mikesamuel@gmail.com on 8 Apr 2012 at 8:57