Make an update for markup to be rendered and inserted at a supplied index.

@param {string} markup Markup that renders into an element.
@param {number} toIndex Destination index.
@private
198389
function makeInsertMarkup(markup, afterNode, toIndex) {
  // NOTE: Null values reduce hidden classes.
  return {
    type: 'INSERT_MARKUP',
    content: markup,
    fromIndex: null,
    fromNode: null,
    toIndex: toIndex,
    afterNode: afterNode
  };
}
234646
function (element, options) {
    // Class Properties
    this.$ns           = 'bootstrap-markdown'
    this.$element      = $(element)
    this.$editable     = {el:null, type:null,attrKeys:[], attrValues:[], content:null}
    this.$options      = $.extend(true, {}, $.fn.markdown.defaults, options, this.$element.data(), this.$element.data('options'))
    this.$oldContent   = null
    this.$isPreview    = false
    this.$isFullscreen = false
    this.$editor       = null
    this.$textarea     = null
    this.$handler      = []
    this.$callback     = []
    this.$nextTab      = []

    this.showEditor()
  }
1039659
function (startIndex, endIndex) {
                if (_.isUndefined(startIndex)) {
                    startIndex = Number.MAX_VALUE;
                }
                if (_.isUndefined(endIndex)) {
                    endIndex = -1;
                }
                var renderer;
                // release unused renderer
                for (var index in this.$activeRenderer) {
                    if (this.$activeRenderer.hasOwnProperty(index) && (index < startIndex || index > endIndex)) {
                        // render not in use
                        renderer = this.$activeRenderer[index];
                        if (renderer) {
                            renderer.set({
                                $index: null,
                                $dataItem: null
                            });

                            renderer.remove();

                            this.$availableRenderer.push(renderer);
                        }

                        delete this.$activeRenderer[index];
                    }
                }
            }
1140796
function applyChange(from, to, text) {
        var delta = from - to + text.length;
        var node = nodeAtLocation(from);

        // insert a text node
        if (!node) {
            if (!(/^\s*$/).test(text)) {
                console.warn("Inserting nodes not supported.");
                node = nodeBeforeLocation(from);
            }
        } else if (node.type === 3) {
            // update a text node
            var value = node.value.substr(0, from - node.location);
            value += text;
            value += node.value.substr(to - node.location);
            node.value = value;
            if (!EditAgent.isEditing) {
                // only update the DOM if the change was not caused by the edit agent
                Inspector.DOM.setNodeValue(node.nodeId, node.value);
            }
        } else {
            console.warn("Changing non-text nodes not supported.");
        }

        // adjust the location of all nodes after the change
        if (node) {
            node.length += delta;
            exports.root.each(function each(n) {
                if (n.location > node.location) {
                    n.location += delta;
                }
                if (n.closeLocation !== undefined && n.closeLocation > node.location) {
                    n.closeLocation += delta;
                }
            });
        }
    }
678757
function makeSetMarkup(markup) {
  // NOTE: Null values reduce hidden classes.
  return {
    type: 'SET_MARKUP',
    content: markup,
    fromIndex: null,
    fromNode: null,
    toIndex: null,
    afterNode: null
  };
}
1218046
function(index) {
        if (this.animating) {
            return;
        }

        var indexes = this._getIndex(index),
            cloneIndex = indexes[0], // The index including clones
            visualIndex = indexes[1]; // The index excluding clones

        // Exit early if jumping to same index
        if (visualIndex === this.index) {
            return;
        }

        this.fireEvent('jumping', [this.index]);

        // Update tabs and items state
        this._updateTabs(visualIndex);
        this._updateItems(cloneIndex);

        // Animate and move the items
        this._beforeCycle();

        if (this.options.animation === 'fade') {
            this.items
                .conceal(true)
                .eq(visualIndex)
                    .transitionend(this._afterCycle.bind(this))
                    .reveal(true);

        } else {
            this.container
                .transitionend(this._afterCycle.bind(this))
                .css(this._position, -this._getSizeSum(cloneIndex));
        }

        // Store the index
        this.index = visualIndex;

        this.reset();
        this.fireEvent('jumped', [visualIndex]);
    }
803575
function Markdown(data = '', options = {}) {

    this.initData = data;
    this.renderTree = null;
    this.html = '';

    this.fullInfo = !!options.fullInfo;
    this.dialect = options.dialect || Markdown.Dialect.DEFAULT;

}
1213059
function upgradeElementsInternal(elements) {
    if (!Array.isArray(elements)) {
      if (elements instanceof Element) {
        elements = [elements];
      } else {
        elements = Array.prototype.slice.call(elements);
      }
    }
    for (var i = 0, n = elements.length, element; i < n; i++) {
      element = elements[i];
      if (element instanceof HTMLElement) {
        upgradeElementInternal(element);
        if (element.children.length > 0) {
          upgradeElementsInternal(element.children);
        }
      }
    }
  }
769874
function render(element, opts) {
    opts = opts || {};

    var prepend = opts.prepend;
    var model = opts.model || {};
    var indentLevel = opts.indentLevel || 0;
    var isPretty = opts.isPretty;
    var jtPrintIndent = isPretty ? '\t' : '';
    var jtPrintNewline = isPretty ? '\n' : '';
    var indent = '', i, len, prop;
    var p = [];  // p is going to be our concatenator for the HTML string

    // if no element, then no HTML so return empty string
    if (!element) { return ''; }

    // if already a string, just return it
    if (utils.isString(element)) { return element; }

    // if an array, wrap it
    if (utils.isArray(element)) { element = naked(element, null); }

    // set the indentation level to the current indent
    if (isPretty && indentLevel) {
        for (i = 0; i < indentLevel; i++) {
            indent += jtPrintIndent;
        }
    }

    // if we are prepending some string, add it first
    if (prepend) {
        p.push(indent, prepend, jtPrintNewline);
    }

    // starting tag open
    if (element.tag) {
        p.push(indent, '<', element.tag);
    }

    // all tag attributes
    if (element.attributes) {
        for (prop in element.attributes) {
            if (element.attributes.hasOwnProperty(prop)) {

                if (element.attributes[prop] === null) {
                    p.push(' ', prop);
                }
                else {
                    p.push(' ', prop, '="', element.attributes[prop], '"');
                }
            }
        }
    }

    // if no children or text, then close the tag
    if (element.tag && !element.children && (element.text === undefined || element.text === null)) {

        // for self closing we just close it, else we add the end tag
        if (selfClosing.indexOf(element.tag) > -1) {
            p.push('/>', jtPrintNewline);
        }
        else {
            p.push('></', element.tag, '>', jtPrintNewline);
        }
    }
    // else we need to add children or the inner text
    else {

        // if a tag (i.e. not just a string literal) put end bracket
        if (element.tag) { p.push('>'); }

        // if children, we will need to recurse
        if (element.children) {
            if (element.tag) { p.push(jtPrintNewline); }

            // recurse down for each child
            for (i = 0, len = element.children.length; i < len; ++i) {
                p.push(render(element.children[i], {
                    indentLevel:    element.tag ? indentLevel + 1 : indentLevel,
                    isPretty:       isPretty,
                    model:          model
                }));
            }

            if (element.tag) { p.push(indent); }
        }

        // if text, simply add it
        if (element.text !== null && element.text !== undefined) { p.push(element.text); }

        // finally if a tag, add close tag
        if (element.tag) {
            p.push('</', element.tag, '>', jtPrintNewline);
        }
    }

    return p.join('');
}
238730
function (o) {
            var self = this;
            o = self.addFoundAt(o);
            Y.each(o, function (i, k1) {
                if (i && i.forEach) {
                    Y.each(i, function (a, k) {
                        if (!(a instanceof Object)) {
                            return;
                        }
                        if (!a.type) {
                            a.type = 'Object'; //Default type is Object
                        }
                        if (a.final === '') {
                            a.final = true;
                        }
                        if (!a.description) {
                            a.description = ' ';
                        } else {
                            //a.description = markdown(a.description, true, self.defaultTags);
                            a.description = self.markdown(a.description);
                        }
                        if (a.example) {
                            a.example = self.markdown(a.example);
                        }
                        a = self.addFoundAt(a);

                        Y.each(a, function (c, d) {
                            if (c.forEach || (c instanceof Object)) {
                                c = self.augmentData(c);
                                a[d] = c;
                            }
                        });

                        o[k1][k] = a;
                    });
                } else if (i instanceof Object) {
                    i = self.addFoundAt(i);
                    Y.each(i, function (v, k) {
                        if (k === 'final') {
                            o[k1][k] = true;
                        }
                        if (k === 'description' || k === 'example') {
                            if (k1 === 'return') {
                                o[k1][k] = self.markdown(v);
                            } else if (v.forEach || (v instanceof Object)) {
                                o[k1][k] = self.augmentData(v);
                            } else {
                                //o[k1][k] = markdown(v, true, self.defaultTags);
                                o[k1][k] = self.markdown(v);
                            }
                        }
                    });
                } else if (k1 === 'description' || k1 === 'example') {
                    //o[k1] = markdown(i, true, self.defaultTags);
                    o[k1] = self.markdown(i);
                }
            });
            return o;
        }
320072
function replaceRenderer(md, renderer) {
  var openMethodName = renderer.fullName + "_open";
  replacedMethods[openMethodName] = md.renderer.rules[openMethodName];

  md.renderer.rules[openMethodName] = function (tokens, idx) {
    var classy, result;

    // first get the result as per the original method we replaced
    result = replacedMethods[openMethodName].apply(null, arguments).trim();

    if (renderer.inline) {
      classy = getClassyFromInlineElement(tokens, idx, renderer.fullName);
    } else {
      classy = getClassyFromBlockElement(tokens, idx, renderer.fullName);
    }

    if (classy) {
      result = result.replace(new RegExp("<" + renderer.pattern), "$& class=\"" + classy.content + "\"");
    }

    return result;
  };
}
300459
function(to) {
            if (this.rectify()) {
                if (this.canMerge(to)) {
                    var rowspan = this.idx_end.row - this.idx_start.row + 1,
                        colspan = this.idx_end.col - this.idx_start.col + 1;

                    for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {
                        for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {

                            if (row == this.idx_start.row && col == this.idx_start.col) {
                                if (rowspan > 1) {
                                    this.map[row][col].el.setAttribute('rowspan', rowspan);
                                }
                                if (colspan > 1) {
                                    this.map[row][col].el.setAttribute('colspan', colspan);
                                }
                            } else {
                                // transfer content
                                if (!(/^\s*<br\/?>\s*$/.test(this.map[row][col].el.innerHTML.toLowerCase()))) {
                                    this.map[this.idx_start.row][this.idx_start.col].el.innerHTML += ' ' + this.map[row][col].el.innerHTML;
                                }
                                removeElement(this.map[row][col].el);
                            }
                        }
                    }
                    this.rectify();
                } else {
                    if (window.console) {
                        console.log('Do not know how to merge allready merged cells.');
                    }
                }
            }
        }
82926
function (out) {
            if (this._cfgOk) {
                this._domId = this._createDynamicId();
                var tagName = this._cfg.type;
                var markup = ['<', tagName, ' id="', this._domId, '"'];
                if (this._cfg.attributes) {
                    markup.push(' ' + ariaUtilsHtml.buildAttributeList(this._cfg.attributes));
                }
                markup.push('></' + tagName + '>');
                out.write(markup.join(''));
            }
        }
683186
function applyMarkup (elem, markup) {
  var node = elem.firstChild,
      index = 0,
      depth = 0,
      markupElem,
      next

  while (node) {
    if (node.nodeType === Node.ELEMENT_NODE) {
      node = node.firstChild
      depth += 1

      continue
    }

    if (index + node.data.length > markup.start) {

      if (index < markup.start) {
        next = node.splitText(markup.start - index)
        index += node.data.length

        node = next
      }

      if (index + node.data.length > markup.end) {
        node.splitText(markup.end - index)
      }

      markupElem = createInline(markup)
      node.parentNode.replaceChild(markupElem, node)
      markupElem.appendChild(node)

      index += node.data.length

      node = markupElem
    } else index += node.data.length

    if (index >= markup.end) break

    while (!node.nextSibling) {
      if (!depth) break

      depth -= 1
      node = node.parentNode
    }

    node = node.nextSibling
  }
}
389027
function markdown(text, inline) {
    var r;

    if (text !== undefined)
      r = md_conrefs.replaceConref(text);

    else
      r = "";

    r = namp(r).html;

    // inline markdown means to strip enclosing tag, which in this case is <p>
    if (inline === true) {
        r = r.slice(3, -5);
    }

    // FIXME
    // desugar [[foo#bar]] tokens into local links
    // N.B. in order to not apply conversion in <code> blocks,
    // we first store replace code blocks with nonces
    var codes = {};
    r = r.replace(/(<code>[\s\S]*?<\/code>)/g, function (all, def) {
      var nonce = Math.random().toString().substring(2);
      codes[nonce] = def;
      return '@-=@=-@' + nonce + '@-=@=-@';
    });

    // convert [[link]] to links
    r = r.replace(/\[\[([\s\S]+?)\]\]/g, function (all, def) {
      def = def.split(/\s+/);
      id = def.shift();
      // invalid references don't produce links
      /*if (!list[id]) {// it's in a different file--list only refers to current page
          obj = fullList[id];

          if (obj === undefined) { // it might be global
              obj = {};
              obj.id = id;
          }
      }*/
      //else {
          obj = list[id];
      //}

      var obj = _.extend({name: def.join(' ') || id, globalId: id}, list[id]);
      obj.name = def.join(' ') || id;

      // lame, but I'm tired of writing stuff like [[child_process.fork `child_process.fork()`]]
      // If I didn't do this, it'd come out as an unstyled link
      if (def.length == 0) {
        if (obj.type === undefined && additionalObjsJSON[obj.name] === undefined && obj.name !== "Mixed") {
          console.error("Error".red + ": you tried to create a short link to an object that doesn't exist!");
          console.error(obj);
        } 

        if (additionalObjsJSON[obj.name] !== undefined)
          obj.name = "<code>" + obj.name + "</code>";
        else if (obj.type && obj.type !== "class" && obj.type.indexOf("property") < 0)
          obj.name = "<code>" + obj.name + "()</code>";
        else
          obj.name = "<code>" + obj.name + "</code>";
      }

      return link(obj, ['link-short'], true);
    });

    // restore code blocks, given previously stored nonces
    r = r.replace(/@-=@=-@(\d+)@-=@=-@/g, function (all, nonce) {
      return codes[nonce];
    });

    return r;
  }
794861
protected void renderDummyMarkup(FacesContext context, UIComponent component, String clientId) throws IOException {
        ResponseWriter writer = context.getResponseWriter();

        writer.startElement("div", null);
        writer.writeAttribute("id", clientId, null);
        writer.writeAttribute("style", "display: none;", null);

        renderPassThruAttributes(context, component, null);

        writer.endElement("div");
    }
824112
function(index, item) {
      this.items[index] = (typeof item == "object") ? item.value : item;
      this.ul.childNodes[index].childNodes[0].innerHTML = (typeof item == "object") ? item.label : item;
   }