tinymce.full.js
function match(name, vars, node) {
        var startNode;

        function matchParents(node) {
          var root = dom.getRoot();

          if (node === root) {
            return false;
          }

          // Find first node with similar format settings
          node = dom.getParent(node, function (node) {
            if (matchesUnInheritedFormatSelector(node, name)) {
              return true;
            }

            return node.parentNode === root || !!matchNode(node, name, vars, true);
          });

          // Do an exact check on the similar format element
          return matchNode(node, name, vars);
        }

        // Check specified node
        if (node) {
          return matchParents(node);
        }

        // Check selected node
        node = selection.getNode();
        if (matchParents(node)) {
          return TRUE;
        }

        // Check start node if it's different
        startNode = selection.getStart();
        if (startNode != node) {
          if (matchParents(startNode)) {
            return TRUE;
          }
        }

        return FALSE;
      }
function match(name, vars, node) {
        var startNode;

        function matchParents(node) {
          var root = dom.getRoot();

          if (node === root) {
            return false;
          }

          // Find first node with similar format settings
          node = dom.getParent(node, function (node) {
            if (matchesUnInheritedFormatSelector(node, name)) {
              return true;
            }

            return node.parentNode === root || !!matchNode(node, name, vars, true);
          });

          // Do an exact check on the similar format element
          return matchNode(node, name, vars);
        }

        // Check specified node
        if (node) {
          return matchParents(node);
        }

        // Check selected node
        node = selection.getNode();
        if (matchParents(node)) {
          return TRUE;
        }

        // Check start node if it's different
        startNode = selection.getStart();
        if (startNode != node) {
          if (matchParents(startNode)) {
            return TRUE;
          }
        }

        return FALSE;
      }
function match ( name , vars , node ) { var startNode ; function matchParents ( node ) { var root = dom . getRoot ( ) ; if ( node === root ) { return false ; } // Find first node with similar format settings node = dom . getParent ( node , function ( node ) { if ( matchesUnInheritedFormatSelector ( node , name ) ) { return true ; } return node . parentNode === root || ! ! matchNode ( node , name , vars , true ) ; } ) ; // Do an exact check on the similar format element return matchNode ( node , name , vars ) ; } // Check specified node if ( node ) { return matchParents ( node ) ; } // Check selected node node = selection . getNode ( ) ; if ( matchParents ( node ) ) { return TRUE ; } // Check start node if it's different startNode = selection . getStart ( ) ; if ( startNode != node ) { if ( matchParents ( startNode ) ) { return TRUE ; } } return FALSE ; }
Matches the current selection or specified node against the specified format name.

@method match
@param {String} name Name of format to match.
@param {Object} vars Optional list of variables to replace before checking it.
@param {Node} node Optional node to check.
@return {boolean} true/false if the specified selection/node matches the format.
Matches the current selection or specified node against the specified format name .