I think it's possible from doing a bit of research but I've not found anything that fits the bill exactly. Forum code is output like this: <pre class="prettyprint lang-autoit ipsCode">
stuff
</pre>The two constant classes are prettyprint and ipsCode. After prettify has run the 'prettyprinted' class is also added. I need a javascript that can cycle though the <pre> tags on a page and if they contain more than 50 lines then wrap them with some additional html something like this (the old geshi code is used as an example) <div class='geshitop'>
<button onclick='geshiExpand(this);'>expand</button>
<button onclick='geshiCollapse(this)' style='display: none'>collapse</button>
<button onclick='geshiPopup(this)'>popup</button>
</div>
<div class='autoit-code-container'>
<pre class="......">
</pre>
</div>Prettify runs after page load so anything this code does needs to cope with that. I'm not sure if that's possible - maybe I could modify the prettify source to call a function at the end. Also the pre tag and content will be being rewritten so we need make sure we go last. I can't control when prettify runs - it's buried in the forum.