Public: Convert the node to a CommonMark string.

 options - A {Symbol} or {Array of Symbol}s indicating the render options
 width - Column to wrap the output at

 Returns a {String}.
190219
def to_commonmark(options = :DEFAULT, width = 120)
      opts = Config.process_options(options, :render)
      _render_commonmark(opts, width).force_encoding('utf-8')
    end
420779
public String optionToHtml(Options.OptionInfo oi, int padding) {
    StringBuilder b = new StringBuilder();
    Formatter f = new Formatter(b);
    if (oi.shortName != null) {
      f.format("<b>-%s</b> ", oi.shortName);
    }
    for (String a : oi.aliases) {
      f.format("<b>%s</b> ", a);
    }
    String prefix = getUseSingleDash() ? "-" : "--";
    f.format("<b>%s%s=</b><i>%s</i>", prefix, oi.longName, oi.typeName);
    if (oi.list != null) {
      b.append(" <code>[+]</code>");
    }
    f.format(".%n ");
    f.format("%s", StringUtils.repeat(" ", padding));

    String jdoc = ((oi.jdoc == null) ? "" : oi.jdoc);
    if (oi.noDocDefault || oi.defaultStr == null) {
      f.format("%s", jdoc);
    } else {
      String defaultStr = "default " + oi.defaultStr;
      // The default string must be HTML-escaped since it comes from a string
      // rather than a Javadoc comment.
      String suffix = "";
      if (jdoc.endsWith("</p>")) {
        suffix = "</p>";
        jdoc = jdoc.substring(0, jdoc.length() - suffix.length());
      }
      f.format("%s [%s]%s", jdoc, StringEscapeUtils.escapeHtml4(defaultStr), suffix);
    }
    if (oi.baseType.isEnum()) {
      b.append(lineSep).append("<ul>").append(lineSep);
      assert oi.enumJdoc != null
          : "@AssumeAssertion(nullness): dependent: non-null if oi.baseType is an enum";
      for (Map.Entry<String, String> entry : oi.enumJdoc.entrySet()) {
        b.append("  <li><b>").append(entry.getKey()).append("</b>");
        if (entry.getValue().length() != 0) {
          b.append(" ").append(entry.getValue());
        }
        // b.append("</li>");
        b.append(lineSep);
      }
      b.append("</ul>").append(lineSep);
    }
    return b.toString();
  }
2336
private String getSingleSlotHtml(TestSlot s, String icon) {
    StringBuilder builder = new StringBuilder();
    TestSession session = s.getSession();
    if (icon != null) {
      builder.append("<img ");
      builder.append("src='").append(icon).append("' width='16' height='16'");
    } else {
      builder.append("<a href='#' ");
    }

    if (session != null) {
      builder.append(" class='busy' ");
      builder.append(" title='").append(session.get("lastCommand")).append("' ");
    } else {
      builder.append(" title='").append(s.getCapabilities()).append("'");
    }

    if (icon != null) {
      builder.append(" />\n");
    } else {
      builder.append(">");
      builder.append(s.getCapabilities().get(CapabilityType.BROWSER_NAME));
      builder.append("</a>");
    }
    return builder.toString();
  }
26246
function(node, symbolizer) {
        var options = symbolizer.vendorOptions;
        if (options) {
            for (var key in symbolizer.vendorOptions) {
                this.writeNode("VendorOption", {
                    name: key, 
                    value: symbolizer.vendorOptions[key]
                }, node);
            }
        }
        return node;
    }
256163
function getNodeProps(node, key, opts, renderer) {
    var props = { key: key }, undef;

    // `sourcePos` is true if the user wants source information (line/column info from markdown source)
    if (opts.sourcePos && node.sourcepos) {
        props['data-sourcepos'] = flattenPosition(node.sourcepos);
    }

    var type = normalizeTypeName(node.type);

    switch (type) {
        case 'html_inline':
        case 'html_block':
            props.isBlock = type === 'html_block';
            props.escapeHtml = opts.escapeHtml;
            props.skipHtml = opts.skipHtml;
            break;
        case 'code_block':
            var codeInfo = node.info ? node.info.split(/ +/) : [];
            if (codeInfo.length > 0 && codeInfo[0].length > 0) {
                props.language = codeInfo[0];
                props.codeinfo = codeInfo;
            }
            break;
        case 'code':
            props.children = node.literal;
            props.inline = true;
            break;
        case 'heading':
            props.level = node.level;
            break;
        case 'softbreak':
            props.softBreak = opts.softBreak;
            break;
        case 'link':
            props.href = opts.transformLinkUri ? opts.transformLinkUri(node.destination) : node.destination;
            props.title = node.title || undef;
            if (opts.linkTarget) {
                props.target = opts.linkTarget;
            }
            break;
        case 'image':
            props.src = opts.transformImageUri ? opts.transformImageUri(node.destination) : node.destination;
            props.title = node.title || undef;

            // Commonmark treats image description as children. We just want the text
            props.alt = node.react.children.join('');
            node.react.children = undef;
            break;
        case 'list':
            props.start = node.listStart;
            props.type = node.listType;
            props.tight = node.listTight;
            break;
        default:
    }

    if (typeof renderer !== 'string') {
        props.literal = node.literal;
    }

    var children = props.children || (node.react && node.react.children);
    if (Array.isArray(children)) {
        props.children = children.reduce(reduceChildren, []) || null;
    }

    return props;
}
63159
function getMarkupWrap(nodeName) {
  invariant(!!dummyNode, 'Markup wrapping node not initialized');
  if (!markupWrap.hasOwnProperty(nodeName)) {
    nodeName = '*';
  }
  if (!shouldWrap.hasOwnProperty(nodeName)) {
    if (nodeName === '*') {
      dummyNode.innerHTML = '<link />';
    } else {
      dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
    }
    shouldWrap[nodeName] = !dummyNode.firstChild;
  }
  return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}
430502
private static String toHtmlTable(final List<OptionWithMetaInfo> options) {
		StringBuilder htmlTable = new StringBuilder();
		htmlTable.append("<table class=\"table table-bordered\">\n");
		htmlTable.append("    <thead>\n");
		htmlTable.append("        <tr>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 20%\">Key</th>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 15%\">Default</th>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 65%\">Description</th>\n");
		htmlTable.append("        </tr>\n");
		htmlTable.append("    </thead>\n");
		htmlTable.append("    <tbody>\n");

		for (OptionWithMetaInfo option : options) {
			htmlTable.append(toHtmlString(option));
		}

		htmlTable.append("    </tbody>\n");
		htmlTable.append("</table>\n");

		return htmlTable.toString();
	}
921701
def format_options(options):
    ''''''
    # split on one of the following tokens: ' -' or '[[' or ']]'
    lines = ['']
    for token in re.split(r'( -|\[\[|\]\])', options):
        if token in ['[[',']]']:
            lines.append(token)
            lines.append('')
        elif token == ' -':
            lines.append(token)
        else:
            lines[-1] += token
    # join all non-empty lines and wrap them into 'span'-tags
    return '<span style="display:block">' + '</span><span style="display:block">'.join(line for line in lines if line.strip()) + '</span>'
710320
def _render(self, text):
        ''''''
        parser = commonmark.Parser()
        ast = parser.parse(text)
        renderer = HtmlRenderer(self)
        html = renderer.render(ast)
        return html
379148
function parseOptions(options) {
    return Object.assign(
        {
            startTag: "never",
            endTag: "never",
            selfClosingTag: "always",

            detectType(node) {
                if (node.type === "HTMLStartTag") {
                    const closeType = node.tagClose.type
                    if (closeType === "HTMLSelfClosingTagClose") {
                        return this.selfClosingTag
                    }
                    return this.startTag
                }
                // HTMLEndTag
                return this.endTag
            },
        },
        options
    )
}
898049
function _print (template, values, options) {
  return template.replace(/\$([\w.]+)/g, function (original, key) {
    const keys = key.split('.')
    let value = values[keys.shift()]
    while (keys.length && value !== undefined) {
      const k = keys.shift()
      value = k ? value[k] : value + '.'
    }

    if (value !== undefined) {
      if (!isString(value)) {
        return format(value, options)
      } else {
        return value
      }
    }

    return original
  }
  )
}
400885
function escapes(options) {
  var settings = options || {}

  if (settings.commonmark) {
    return commonmark
  }

  return settings.gfm ? gfm : defaults
}
830597
function TmplObject(markup, options) {
		// Template object constructor
		var htmlTag,
			wrapMap = $viewsSettings.wrapMap || {},
			tmpl = $extend(
				{
					markup: markup,
					tmpls: [],
					links: {},
					bnds: [],
					render: renderContent
				},
				options
			);

		if (!options.htmlTag) {
			// Set tmpl.tag to the top-level HTML tag used in the template, if any...
			htmlTag = rFirstElem.exec(markup);
			tmpl.htmlTag = htmlTag ? htmlTag[1].toLowerCase() : "";
		}
		htmlTag = wrapMap[tmpl.htmlTag];
		if (htmlTag && htmlTag !== wrapMap.div) {
			// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').
			tmpl.markup = $.trim(tmpl.markup);
			tmpl._elCnt = TRUE; // element content model (no rendered text nodes), not phrasing content model
		}

		return tmpl;
	}
392505
def to_string_interpolation(node_or_interp)
      unless node_or_interp.is_a?(Interpolation)
        node = node_or_interp
        return string_literal(node.value.to_s) if node.is_a?(Literal)
        if node.is_a?(StringInterpolation)
          return concat(string_literal(node.quote), concat(node, string_literal(node.quote)))
        end
        return StringInterpolation.new(string_literal(""), node, string_literal(""))
      end

      interp = node_or_interp
      after_string_or_interp =
        if interp.after
          to_string_interpolation(interp.after)
        else
          string_literal("")
        end
      if interp.after && interp.whitespace_after
        after_string_or_interp = concat(string_literal(' '), after_string_or_interp)
      end

      mid_string_or_interp = to_string_interpolation(interp.mid)

      before_string_or_interp =
        if interp.before
          to_string_interpolation(interp.before)
        else
          string_literal("")
        end
      if interp.before && interp.whitespace_before
        before_string_or_interp = concat(before_string_or_interp, string_literal(' '))
      end

      concat(before_string_or_interp, concat(mid_string_or_interp, after_string_or_interp))
    end
1373531
def render(options = {})
      options[:graph_id]    ||= 'scruffy_graph'
      options[:complexity]  ||= (global_complexity || :normal)

      # Allow subclasses to muck with components prior to renders.
      rendertime_renderer = self.clone
      rendertime_renderer.instance_eval { before_render if respond_to?(:before_render) }

      svg = Builder::XmlMarkup.new(:indent => 2)
      unless options[:no_doctype_header]
        svg.instruct!
        svg.declare! :DOCTYPE, :svg, :PUBLIC, "-//W3C//DTD SVG 1.0//EN", "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
      end
      svg.svg(:xmlns => "http://www.w3.org/2000/svg", 'xmlns:xlink' => "http://www.w3.org/1999/xlink", :width => options[:size].first, :height => options[:size].last) {
        svg.g(:id => options[:graph_id]) {
          rendertime_renderer.components.each do |component|
            component.render(svg, 
                             bounds_for( options[:size], component.position, component.size ), 
                             options)
          end
        }
      }
      svg.target!
    end
588265
function formatAdMarkup(bid) {
  let adm = bid.adm;
  if ('nurl' in bid) {
    adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`);
  }
  return adm;
}
46000
def format_options_to_cell(ask, options = @column_options)
      options.each do |key, value|
        if only_cell_option?(key)
          if ask.is_a? Hash
            ask.merge!(key => value)
          else            
            ask = [ask] unless ask.is_a? Array
            (ask.last.is_a? Hash and ask.last.has_key? :html) ? ask.last[:html].merge!(key => value) : ask << { :html =>  { key => value }} 
          end
        end
      end
      ask
    end