Impossible to prettify when the content is dynamically added in the
DOM.
I found a solution by creating my own prettifier which works only for
HTML, really basic (many regexp) but it does what I want. It can be
improved, but I don't have the time to do that. If it can help anyone,
you have the code just here :
================================
function debug(txt)
{
txt = txt
.replace(/</g, '<').replace(/>/g, '>').replace(/"/g,
'"').replace(/'/g, ''').replace(/=/g, '=')
.replace(/ ([^(=) ]*)(=)/g, ' <span class="gf">$1</span>$2')
.replace(/<(\/?)([^!|( <)|(>=)|(<\/)|]*)>/g, '<$1<span
class="b">$2</span>>')
.replace(/<([^!<>]*) /g, '<<span class="b">$1</span> ')
.replace(/("|')([^(")|(')]*)("|')/g, '$1<span
class="v">$2</span>$3')
.replace(/=/g, '<span class="rf">=</span>').replace(/\/>/
g, '<span class="rf">/</span>>');
$( '#debug pre' ).empty().append( txt );
$( '#debug' ).show();
}
================================