example/public/ueditor/third-party/SyntaxHighlighter/shCore.js
function(globalParams, element)
        {
            var elements = this.findElements(globalParams, element),
                propertyName = 'innerHTML',
                highlighter = null,
                conf = sh.config
                ;

            if (elements.length === 0)
                return;

            for (var i = 0; i < elements.length; i++)
            {
                var element = elements[i],
                    target = element.target,
                    params = element.params,
                    brushName = params.brush,
                    code
                    ;

                if (brushName == null)
                    continue;

                // Instantiate a brush
                if (params['html-script'] == 'true' || sh.defaults['html-script'] == true)
                {
                    highlighter = new sh.HtmlScript(brushName);
                    brushName = 'htmlscript';
                }
                else
                {
                    var brush = findBrush(brushName);

                    if (brush)
                        highlighter = new brush();
                    else
                        continue;
                }

                code = target[propertyName];

                // remove CDATA from <SCRIPT/> tags if it's present
                if (conf.useScriptTags)
                    code = stripCData(code);

                // Inject title if the attribute is present
                if ((target.title || '') != '')
                    params.title = target.title;

                params['brush'] = brushName;
                highlighter.init(params);
                element = highlighter.getDiv(code);

                // carry over ID
                if ((target.id || '') != '')
                    element.id = target.id;
                //by zhanyi 去掉多余的外围div
                var tmp = element.firstChild.firstChild;
                tmp.className = element.firstChild.className;

                target.parentNode.replaceChild(tmp, target);
            }
        }
function(globalParams, element)
        {
            var elements = this.findElements(globalParams, element),
                propertyName = 'innerHTML',
                highlighter = null,
                conf = sh.config
                ;

            if (elements.length === 0)
                return;

            for (var i = 0; i < elements.length; i++)
            {
                var element = elements[i],
                    target = element.target,
                    params = element.params,
                    brushName = params.brush,
                    code
                    ;

                if (brushName == null)
                    continue;

                // Instantiate a brush
                if (params['html-script'] == 'true' || sh.defaults['html-script'] == true)
                {
                    highlighter = new sh.HtmlScript(brushName);
                    brushName = 'htmlscript';
                }
                else
                {
                    var brush = findBrush(brushName);

                    if (brush)
                        highlighter = new brush();
                    else
                        continue;
                }

                code = target[propertyName];

                // remove CDATA from <SCRIPT/> tags if it's present
                if (conf.useScriptTags)
                    code = stripCData(code);

                // Inject title if the attribute is present
                if ((target.title || '') != '')
                    params.title = target.title;

                params['brush'] = brushName;
                highlighter.init(params);
                element = highlighter.getDiv(code);

                // carry over ID
                if ((target.id || '') != '')
                    element.id = target.id;
                //by zhanyi 去掉多余的外围div
                var tmp = element.firstChild.firstChild;
                tmp.className = element.firstChild.className;

                target.parentNode.replaceChild(tmp, target);
            }
        }
function ( globalParams , element ) { var elements = this . findElements ( globalParams , element ) , propertyName = 'innerHTML' , highlighter = null , conf = sh . config ; if ( elements . length === 0 ) return ; for ( var i = 0 ; i < elements . length ; i ++ ) { var element = elements [ i ] , target = element . target , params = element . params , brushName = params . brush , code ; if ( brushName == null ) continue ; // Instantiate a brush if ( params [ 'html-script' ] == 'true' || sh . defaults [ 'html-script' ] == true ) { highlighter = new sh . HtmlScript ( brushName ) ; brushName = 'htmlscript' ; } else { var brush = findBrush ( brushName ) ; if ( brush ) highlighter = new brush ( ) ; else continue ; } code = target [ propertyName ] ; // remove CDATA from <SCRIPT/> tags if it's present if ( conf . useScriptTags ) code = stripCData ( code ) ; // Inject title if the attribute is present if ( ( target . title || '' ) != '' ) params . title = target . title ; params [ 'brush' ] = brushName ; highlighter . init ( params ) ; element = highlighter . getDiv ( code ) ; // carry over ID if ( ( target . id || '' ) != '' ) element . id = target . id ; //by zhanyi 去掉多余的外围div var tmp = element . firstChild . firstChild ; tmp . className = element . firstChild . className ; target . parentNode . replaceChild ( tmp , target ) ; } }
Shorthand to highlight all elements on the page that are marked as
SyntaxHighlighter source code.

@param {Object} globalParams		Optional parameters which override element's
parameters. Only used if element is specified.

@param {Object} element	Optional element to highlight. If none is
provided, all elements in the current document
are highlighted.
Shorthand to highlight all elements on the page that are marked as SyntaxHighlighter source code .