トークンをレンダリングした結果を返す

@param {object} token
各トークンのインスタンス
@return {string}
HTML文字列
350807
function renderToken(token) {
  var syntax = token.getCGSyntax();
  if (syntax in renderFunc === false) {
    throw new Error('Undefined syntax: ' + syntax);
  }

  return renderFunc[syntax](token.getBody(), this.MDRenderer);
}
759820
function gulpHtmlLint(options) {
	let htmlLintOptions = {},
		issueFileCount = 0,
		issueCount = 0;

	options = options || {};
	options.htmllintrc = options.htmllintrc || '.htmllintrc';
	options.useHtmllintrc = options.useHtmllintrc !== false;
	options.plugins = options.plugins || [];
	options.limitFiles = options.limitFiles || (options.bail ? 1 : Number.MAX_VALUE);
	options.limitIssuesPerFile = options.limitIssuesPerFile || Number.MAX_VALUE;
	options.limitIssues = options.limitIssues || Number.MAX_VALUE;

	// load htmllint rules
	if (options.useHtmllintrc && fs.existsSync(options.htmllintrc)) {
		htmlLintOptions = JSON.parse(fs.readFileSync(options.htmllintrc, 'utf8'));
	}
	if (options.rules && typeof options.rules === 'object') {
		Object.keys(options.rules).forEach((prop) => {
			htmlLintOptions[prop] = options.rules[prop];
		});
	}

	// use plugins
	htmllint.use(options.plugins);

	return transform((file, enc, cb) => {
		if (file.isNull()) return cb(null, file);
		if (file.isStream()) return cb(new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));
		if (issueFileCount >= options.limitFiles ||
			issueCount >= options.limitIssues) return cb(null, file);
		const relativeFilePath = path.relative(process.cwd(), file.path);
		htmllint(file.contents.toString(), htmlLintOptions)
			.then((issues) => {
				if (issues && issues.length) {
					let errorCount = 0,
						warningCount = 0;
					issueFileCount++;
					issueCount += issues.length;
					issues.forEach((issue) => {
						if (issue.code.indexOf('E') === 0) {
							issue.error = true;
							errorCount++;
						} else {
							issue.error = false;
							warningCount++;
						}
						issue.warning = !issue.error;
						issue.message = issue.message || htmllint.messages.renderIssue(issue);
					});
					file.htmlLint = {
						filePath: file.path,
						issues: issues.splice(0, Math.min(issues.length, options.limitIssuesPerFile)),
						relativeFilePath,
						errorCount,
						warningCount
					};
				}
				cb(null, file);
			}, () => {
				return cb(new gutil.PluginError(PLUGIN_NAME, `Could not lint html file: ${relativeFilePath}`));
			});
	});
}
788267
def get_token(self, token):
        '''
        
        '''
        load = {}
        load['token'] = token
        load['cmd'] = 'get_token'
        tdata = self._send_token_request(load)
        return tdata
804087
public function generateScriptFromToken($token)
    {
        if (!$token instanceof HTMLPurifier_Token_Text) {
            return $this->generateFromToken($token);
        }
        // Thanks <http://lachy.id.au/log/2005/05/script-comments>
        $data = preg_replace('#//\s*$#', '', $token->data);
        return '<!--//--><![CDATA[//><!--' . "\n" . trim($data) . "\n" . '//--><!]]>';
    }
259912
function getTOC(document) {
  var content = "";
  if (document.generateContentsCallback) {
    var callbackContent = document.generateContentsCallback(document.filesForTOC);
    content = markupFiles.getContents(document, callbackContent);
  } else {
    content = markupFiles.getContents(document);
  }
  return replacements(document, replacements(document, content));
}
1129774
function select_token (token) {
          if (!$(input).data("settings").disabled) {
              token.addClass($(input).data("settings").classes.selectedToken);
              selected_token = token.get(0);

              // Hide input box
              input_box.val("");

              // Hide dropdown if it is visible (eg if we clicked to select token)
              hide_dropdown();
          }
      }
797891
function getInnerHTML(node) {
	if (!node.children) return '';
	if (!isArray(node.children) && typeof HTMLCollection !== 'undefined' && !(node.children instanceof HTMLCollection)) node.children = [node.children];

	return (isArray(node) && node || (typeof HTMLCollection !== 'undefined' && node.children instanceof HTMLCollection ? [].slice.call(node.children) : node.children)).map(function (child) {
		if ((typeof child === 'undefined' ? 'undefined' : _typeof(child)) !== 'object') {
			return '' + child;
		} else if (isArray(child)) {
			return getInnerHTML(child);
		} else {
			var attributes = [''].concat(Object.keys(child.attributes).map(function (attr) {
				return attr + '="' + child.attributes[attr].value + '"';
			}));
			if (['img', 'link', 'meta', 'input', 'br', 'area', 'base', 'param', 'source', 'hr', 'embed'].indexOf(child.tagName) < 0) {
				return '<' + child.tagName + attributes.join(' ') + '>' + getInnerHTML(child) + '</' + child.tagName + '>';
			} else {
				return '<' + child.tagName + attributes.join(' ') + '/>';
			}
		}
	}).join('');
}
1104129
function Token(type, tag, nesting) {
  /**
   * Token#type -> String
   *
   * Type of the token (string, e.g. "paragraph_open")
   **/
  this.type     = type;

  /**
   * Token#tag -> String
   *
   * html tag name, e.g. "p"
   **/
  this.tag      = tag;

  /**
   * Token#attrs -> Array
   *
   * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
   **/
  this.attrs    = null;

  /**
   * Token#map -> Array
   *
   * Source map info. Format: `[ line_begin, line_end ]`
   **/
  this.map      = null;

  /**
   * Token#nesting -> Number
   *
   * Level change (number in {-1, 0, 1} set), where:
   *
   * -  `1` means the tag is opening
   * -  `0` means the tag is self-closing
   * - `-1` means the tag is closing
   **/
  this.nesting  = nesting;

  /**
   * Token#level -> Number
   *
   * nesting level, the same as `state.level`
   **/
  this.level    = 0;

  /**
   * Token#children -> Array
   *
   * An array of child nodes (inline and img tokens)
   **/
  this.children = null;

  /**
   * Token#content -> String
   *
   * In a case of self-closing tag (code, html, fence, etc.),
   * it has contents of this tag.
   **/
  this.content  = '';

  /**
   * Token#markup -> String
   *
   * '*' or '_' for emphasis, fence string for fence, etc.
   **/
  this.markup   = '';

  /**
   * Token#info -> String
   *
   * fence infostring
   **/
  this.info     = '';

  /**
   * Token#meta -> Object
   *
   * A place for plugins to store an arbitrary data
   **/
  this.meta     = null;

  /**
   * Token#block -> Boolean
   *
   * True for block-level tokens, false for inline tokens.
   * Used in renderer to calculate line breaks
   **/
  this.block    = false;

  /**
   * Token#hidden -> Boolean
   *
   * If it's true, ignore this element when rendering. Used for tight lists
   * to hide paragraphs.
   **/
  this.hidden   = false;
}
164833
function getBlockContent(tokens, type, markup, start = false) {
  const content = {
    type,
    content: processBlockTokens(tokens.slice(1, -1)), // eslint-disable-line
    markup
  };
  if (start) {
    content.start = start;
  }
  return content;
}
1123734
function getHtmlFromMarkedMarkdown(srcStr) {
	var result = parseSource(srcStr);
	var html = md.render(result);
	return html;
}
1249215
protected String getTemplate(Token token) {
        TemplateRenderer templateRenderer = activity.getActivityContext().getTemplateRenderer();

        StringWriter writer = new StringWriter();
        templateRenderer.render(token.getName(), activity, writer);

        String result = writer.toString();
        return (result != null ? result : token.getDefaultValue());
    }
73821
function tokenPart(token){
        var part = makePartSpan(token.value, self.doc);     
        part.className = token.style;
        return part;
      }
428827
function getTemplateTagByToken(token) {
            return microTemplateService
                .getMicroTemplateTokens()
                .find(
                    t =>
                        t.expressionStart.range[1] <= token.range[0] &&
                        token.range[0] < t.expressionEnd.range[0]
                )
        }
1132958
function( HTMLCode ){
        var values = {},
            $parent = cheerio.load( utils.activateInstanceTags( HTMLCode ), { decodeEntities: false } ),
            $self = cheerio.load( utils.activateTemplateTags( HTMLCode ), { decodeEntities: false } ),
            templateAttr;

        // まず、親テンプレートから継承したプレースホルダから値を抽出する。
        // 次に、自身のプレースホルダから値を抽出する。
        // 親テンプレートから継承したプレースホルダがある場合、自身の値で上書きする。
        [
            [ $parent, [ "InstanceEditable" ] ],
            [ $self, [ "TemplateEditable" ] ]
        ]
            .map( function( testSet ){
                var $doc = testSet[0 ],
                    selectors = testSet[ 1 ];

                selectors.map( function( selector ){
                    $doc( selector ).each( function( index, element ){
                        values[ $doc( element ).attr( "name" ) ] =
                            this.convertResourcePathFormat( $doc( element ).html() );
                    }.bind( this ) );
                }, this );
            }, this );

        // <!-- InstanceBegin template --> の属性を取得
        templateAttr = HTMLCode.match( /<!-- InstanceBegin template="[^"]+"([^>]*) -->/i );
        if( templateAttr ){
            values[ "__template_attr__" ] = templateAttr[ 1 ];
        }

        utils.log( this.id, "defaultValues", values );

        return values;
    }
396923
function extract(token) {
        var obj = {};
        Object.keys(token).map(function(k) {
            if ( !ignore.has(k) ) {
                obj[k] = token[k];
            }
        });
        return obj;
    }
52862
public function compileToken(array $token): string
    {
        if (in_array($token[self::TOKEN_TYPE], [self::PLAIN_TEXT, self::TAG_CLOSE])) {
            //Nothing to compile
            return $token[HtmlTokenizer::TOKEN_CONTENT];
        }

        $result = $token[HtmlTokenizer::TOKEN_NAME];
        $attributes = [];
        foreach ($token[self::TOKEN_ATTRIBUTES] as $attribute => $value) {
            if ($value === null) {
                $attributes[] = $attribute;
                continue;
            }

            $attributes[] = $attribute . '="' . $value . '"';
        }

        if (!empty($attributes)) {
            $result .= ' ' . join(' ', $attributes);
        }

        if ($token[HtmlTokenizer::TOKEN_TYPE] == HtmlTokenizer::TAG_SHORT) {
            $result .= '/';
        }

        return '<' . $result . '>';
    }
512027
function (token, k) {
        var str = "";
        for (var i = 0; i < k && i < token.length; i++)
            str += token[i];
        if (i < token.length) {
            str += "<";
            str += token[i++];
            str += ">";
            for (; i < token.length; i++)
                str += token[i];
        }
        return str;
    }