dist/tulipan.cjs.js
/**
 * Process an element or a DocumentFragment based on a
 * instance option object. This allows us to transclude
 * a template node/fragment before the instance is created,
 * so the processed fragment can then be cloned and reused
 * in tp-for.
 *
 * @param {Element} el
 * @param {Object} options
 * @return {Element|DocumentFragment}
 */
Process an element or a DocumentFragment based on a
instance option object. This allows us to transclude
a template node/fragment before the instance is created,
so the processed fragment can then be cloned and reused
in tp-for.

@param {Element} el
@param {Object} options
@return {Element|DocumentFragment}
Process an element or a DocumentFragment based on a instance option object . This allows us to transclude a template node / fragment before the instance is created so the processed fragment can then be cloned and reused in tp - for . @param { Element } el @param { Object } options @return { Element|DocumentFragment }
function transclude(el, options) {
  if (options) {
    options._containerAttrs = extractAttrs(el);
  }
  if (isTemplate(el)) {
    el = parseTemplate(el);
  }
  if (options) {
    if (options._asComponent && !options.template) {
      options.template = '<slot></slot>';
    }
    if (options.template) {
      options._content = extractContent(el);
      el = transcludeTemplate(el, options);
    }
  }
  if (isFragment(el)) {
    prepend(createAnchor('tp-start', true), el);
    el.appendChild(createAnchor('tp-end', true));
  }
  return el;
}
function transclude ( el , options ) { if ( options ) { options . _containerAttrs = extractAttrs ( el ) ; } if ( isTemplate ( el ) ) { el = parseTemplate ( el ) ; } if ( options ) { if ( options . _asComponent && ! options . template ) { options . template = '<slot></slot>' ; } if ( options . template ) { options . _content = extractContent ( el ) ; el = transcludeTemplate ( el , options ) ; } } if ( isFragment ( el ) ) { prepend ( createAnchor ( 'tp-start' , true ) , el ) ; el . appendChild ( createAnchor ( 'tp-end' , true ) ) ; } return el ; }
Process an element or a DocumentFragment based on a
 instance option object.
Process an element or a DocumentFragment based on a instance option object .
// extract container attributes to pass them down // to compiler, because they need to be compiled in // parent scope. we are mutating the options object here // assuming the same object will be used for compile // right after this. // for template tags, what we want is its content as // a documentFragment (for fragment instances) // anchors for fragment instance // passing in `persist: true` to avoid them being // discarded by IE during template cloning