js/tinymce/tinymce.jquery.js
function (node, args) {
          var self = this, impl, doc, oldDoc, htmlSerializer, content, rootNode;

          // Explorer won't clone contents of script and style and the
          // selected index of select elements are cleared on a clone operation.
          if (Env.ie && dom.select('script,style,select,map').length > 0) {
            content = node.innerHTML;
            node = node.cloneNode(false);
            dom.setHTML(node, content);
          } else {
            node = node.cloneNode(true);
          }

          // Nodes needs to be attached to something in WebKit/Opera
          // This fix will make DOM ranges and make Sizzle happy!
          impl = document.implementation;
          if (impl.createHTMLDocument) {
            // Create an empty HTML document
            doc = impl.createHTMLDocument("");

            // Add the element or it's children if it's a body element to the new document
            each(node.nodeName == 'BODY' ? node.childNodes : [node], function (node) {
              doc.body.appendChild(doc.importNode(node, true));
            });

            // Grab first child or body element for serialization
            if (node.nodeName != 'BODY') {
              node = doc.body.firstChild;
            } else {
              node = doc.body;
            }

            // set the new document in DOMUtils so createElement etc works
            oldDoc = dom.doc;
            dom.doc = doc;
          }

          args = args || {};
          args.format = args.format || 'html';

          // Don't wrap content if we want selected html
          if (args.selection) {
            args.forced_root_block = '';
          }

          // Pre process
          if (!args.no_events) {
            args.node = node;
            self.onPreProcess(args);
          }

          // Parse HTML
          content = Zwsp.trim(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)));
          rootNode = htmlParser.parse(content, args);
          trimTrailingBr(rootNode);

          // Serialize HTML
          htmlSerializer = new Serializer(settings, schema);
          args.content = htmlSerializer.serialize(rootNode);

          // Post process
          if (!args.no_events) {
            self.onPostProcess(args);
          }

          // Restore the old document if it was changed
          if (oldDoc) {
            dom.doc = oldDoc;
          }

          args.node = null;

          return args.content;
        }
function (node, args) {
          var self = this, impl, doc, oldDoc, htmlSerializer, content, rootNode;

          // Explorer won't clone contents of script and style and the
          // selected index of select elements are cleared on a clone operation.
          if (Env.ie && dom.select('script,style,select,map').length > 0) {
            content = node.innerHTML;
            node = node.cloneNode(false);
            dom.setHTML(node, content);
          } else {
            node = node.cloneNode(true);
          }

          // Nodes needs to be attached to something in WebKit/Opera
          // This fix will make DOM ranges and make Sizzle happy!
          impl = document.implementation;
          if (impl.createHTMLDocument) {
            // Create an empty HTML document
            doc = impl.createHTMLDocument("");

            // Add the element or it's children if it's a body element to the new document
            each(node.nodeName == 'BODY' ? node.childNodes : [node], function (node) {
              doc.body.appendChild(doc.importNode(node, true));
            });

            // Grab first child or body element for serialization
            if (node.nodeName != 'BODY') {
              node = doc.body.firstChild;
            } else {
              node = doc.body;
            }

            // set the new document in DOMUtils so createElement etc works
            oldDoc = dom.doc;
            dom.doc = doc;
          }

          args = args || {};
          args.format = args.format || 'html';

          // Don't wrap content if we want selected html
          if (args.selection) {
            args.forced_root_block = '';
          }

          // Pre process
          if (!args.no_events) {
            args.node = node;
            self.onPreProcess(args);
          }

          // Parse HTML
          content = Zwsp.trim(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)));
          rootNode = htmlParser.parse(content, args);
          trimTrailingBr(rootNode);

          // Serialize HTML
          htmlSerializer = new Serializer(settings, schema);
          args.content = htmlSerializer.serialize(rootNode);

          // Post process
          if (!args.no_events) {
            self.onPostProcess(args);
          }

          // Restore the old document if it was changed
          if (oldDoc) {
            dom.doc = oldDoc;
          }

          args.node = null;

          return args.content;
        }
function ( node , args ) { var self = this , impl , doc , oldDoc , htmlSerializer , content , rootNode ; // Explorer won't clone contents of script and style and the // selected index of select elements are cleared on a clone operation. if ( Env . ie && dom . select ( 'script,style,select,map' ) . length > 0 ) { content = node . innerHTML ; node = node . cloneNode ( false ) ; dom . setHTML ( node , content ) ; } else { node = node . cloneNode ( true ) ; } // Nodes needs to be attached to something in WebKit/Opera // This fix will make DOM ranges and make Sizzle happy! impl = document . implementation ; if ( impl . createHTMLDocument ) { // Create an empty HTML document doc = impl . createHTMLDocument ( "" ) ; // Add the element or it's children if it's a body element to the new document each ( node . nodeName == 'BODY' ? node . childNodes : [ node ] , function ( node ) { doc . body . appendChild ( doc . importNode ( node , true ) ) ; } ) ; // Grab first child or body element for serialization if ( node . nodeName != 'BODY' ) { node = doc . body . firstChild ; } else { node = doc . body ; } // set the new document in DOMUtils so createElement etc works oldDoc = dom . doc ; dom . doc = doc ; } args = args || { } ; args . format = args . format || 'html' ; // Don't wrap content if we want selected html if ( args . selection ) { args . forced_root_block = '' ; } // Pre process if ( ! args . no_events ) { args . node = node ; self . onPreProcess ( args ) ; } // Parse HTML content = Zwsp . trim ( trim ( args . getInner ? node . innerHTML : dom . getOuterHTML ( node ) ) ) ; rootNode = htmlParser . parse ( content , args ) ; trimTrailingBr ( rootNode ) ; // Serialize HTML htmlSerializer = new Serializer ( settings , schema ) ; args . content = htmlSerializer . serialize ( rootNode ) ; // Post process if ( ! args . no_events ) { self . onPostProcess ( args ) ; } // Restore the old document if it was changed if ( oldDoc ) { dom . doc = oldDoc ; } args . node = null ; return args . content ; }
Serializes the specified browser DOM node into a HTML string.

@method serialize
@param {DOMNode} node DOM node to serialize.
@param {Object} args Arguments option that gets passed to event handlers.
Serializes the specified browser DOM node into a HTML string .