Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

prettyPrint() double call #185

Closed
GoogleCodeExporter opened this issue Apr 22, 2015 · 3 comments
Closed

prettyPrint() double call #185

GoogleCodeExporter opened this issue Apr 22, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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 i...@gmx.com on 24 Jan 2012 at 6:50

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Issue 40 has been merged into this issue.

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

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

No branches or pull requests

2 participants