tylerlong / google-code-prettify

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

Improve performance on large single chunks #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Prettifying a single <pre> tag containing thousands of lines of code can
block the UI.

Original issue reported on code.google.com by mikesamuel@gmail.com on 15 Aug 2007 at 8:47

GoogleCodeExporter commented 9 years ago
What if a verylarge <pre> tag was broken into a series of smaller <pre> tags?  
Your
continuation logic would keep the brower responsive, but the source code in 
blocks
other than the first might be incorrectly highlighted, e.g., if the preceeding 
<pre>
started a block comment and a multi-line string.

Maybe one way to address that would be for prettyPrintOne() to also accept a
reference to the next element that will be worked on (not the source code text 
of
that element).  Then, prettyPrintOne() could store a little momento of it's 
state in
some field of that next element, and that state could be restored when
prettyPrintOne() begins to operate on the next element.

Original comment by jrobb...@gmail.com on 20 Oct 2007 at 1:03

GoogleCodeExporter commented 9 years ago
It'd require a serious rewrite if I wanted to allow the <pre> to be interrupted 
in
the middle of a token.

It would be nice to be able to skip over line number markers (in mondrian) but 
there
are other ways to do that.

How finely grained were you thinking of making these splits?

Original comment by mikesamuel@gmail.com on 23 Oct 2007 at 4:54

GoogleCodeExporter commented 9 years ago
closing for lack of response

Original comment by mikesamuel@gmail.com on 5 Jul 2008 at 10:14