tinymce.full.js
function addCustomElements(customElements) {
        var customElementRegExp = /^(~)?(.+)$/;

        if (customElements) {
          // Flush cached items since we are altering the default maps
          mapCache.text_block_elements = mapCache.block_elements = null;

          each(split(customElements, ','), function (rule) {
            var matches = customElementRegExp.exec(rule),
              inline = matches[1] === '~',
              cloneName = inline ? 'span' : 'div',
              name = matches[2];

            children[name] = children[cloneName];
            customElementsMap[name] = cloneName;

            // If it's not marked as inline then add it to valid block elements
            if (!inline) {
              blockElementsMap[name.toUpperCase()] = {};
              blockElementsMap[name] = {};
            }

            // Add elements clone if needed
            if (!elements[name]) {
              var customRule = elements[cloneName];

              customRule = extend({}, customRule);
              delete customRule.removeEmptyAttrs;
              delete customRule.removeEmpty;

              elements[name] = customRule;
            }

            // Add custom elements at span/div positions
            each(children, function (element, elmName) {
              if (element[cloneName]) {
                children[elmName] = element = extend({}, children[elmName]);
                element[name] = element[cloneName];
              }
            });
          });
        }
      }
function addCustomElements(customElements) {
        var customElementRegExp = /^(~)?(.+)$/;

        if (customElements) {
          // Flush cached items since we are altering the default maps
          mapCache.text_block_elements = mapCache.block_elements = null;

          each(split(customElements, ','), function (rule) {
            var matches = customElementRegExp.exec(rule),
              inline = matches[1] === '~',
              cloneName = inline ? 'span' : 'div',
              name = matches[2];

            children[name] = children[cloneName];
            customElementsMap[name] = cloneName;

            // If it's not marked as inline then add it to valid block elements
            if (!inline) {
              blockElementsMap[name.toUpperCase()] = {};
              blockElementsMap[name] = {};
            }

            // Add elements clone if needed
            if (!elements[name]) {
              var customRule = elements[cloneName];

              customRule = extend({}, customRule);
              delete customRule.removeEmptyAttrs;
              delete customRule.removeEmpty;

              elements[name] = customRule;
            }

            // Add custom elements at span/div positions
            each(children, function (element, elmName) {
              if (element[cloneName]) {
                children[elmName] = element = extend({}, children[elmName]);
                element[name] = element[cloneName];
              }
            });
          });
        }
      }
function addCustomElements ( customElements ) { var customElementRegExp = / ^(~)?(.+)$ / ; if ( customElements ) { // Flush cached items since we are altering the default maps mapCache . text_block_elements = mapCache . block_elements = null ; each ( split ( customElements , ',' ) , function ( rule ) { var matches = customElementRegExp . exec ( rule ) , inline = matches [ 1 ] === '~' , cloneName = inline ? 'span' : 'div' , name = matches [ 2 ] ; children [ name ] = children [ cloneName ] ; customElementsMap [ name ] = cloneName ; // If it's not marked as inline then add it to valid block elements if ( ! inline ) { blockElementsMap [ name . toUpperCase ( ) ] = { } ; blockElementsMap [ name ] = { } ; } // Add elements clone if needed if ( ! elements [ name ] ) { var customRule = elements [ cloneName ] ; customRule = extend ( { } , customRule ) ; delete customRule . removeEmptyAttrs ; delete customRule . removeEmpty ; elements [ name ] = customRule ; } // Add custom elements at span/div positions each ( children , function ( element , elmName ) { if ( element [ cloneName ] ) { children [ elmName ] = element = extend ( { } , children [ elmName ] ) ; element [ name ] = element [ cloneName ] ; } } ) ; } ) ; } }
Adds custom non HTML elements to the schema
Adds custom non HTML elements to the schema