zzyengineer / google-code-prettify

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

prettyPrint() double call #185

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add prettyPrint() fn call to onLoad event.
2. Add new elemenet with source code in any supported language.
3. Call prettyPrint() func again.

What is the expected output?
Prettify only added element.

What do you see instead?
Rendered appearence of old elements with code doesn't change. However, all 
pretify tags inside this elements are doubled. This is really annoying when you 
do many AJAX requests adding new sources to the page because you get not so 
clean markup as it was.

What version are you using?
Latest.

On what browser?
Doesn't matter.

Additional information.
I think, pretified elements should be marked and ignored when calling 
prettyPrint() twice.
As a workaround I sugest users with same problem just to remove "prettyprint" 
mark from code element's class after first call to prettyPrint(). But this is 
not a good solution as you have to enumerate this elements in second loop too.

Original issue reported on code.google.com by ins...@gmail.com on 24 Jan 2012 at 6:50

GoogleCodeExporter commented 9 years ago
Unfortunately the prettyprint class is used by CSS including custom style 
sheets, so that would break a lot of things.  I will look into adding a 
'prettyprinted' class and prevent rehandling by not prettyprinting when 
prettyprinted is present.

Original comment by mikesamuel@gmail.com on 30 Mar 2012 at 4:39

GoogleCodeExporter commented 9 years ago
Fixed at http://code.google.com/p/google-code-prettify/source/detail?r=204#

Original comment by mikesamuel@gmail.com on 30 Mar 2012 at 4:49

GoogleCodeExporter commented 9 years ago
Issue 40 has been merged into this issue.

Original comment by mikesamuel@gmail.com on 23 Apr 2012 at 4:18