wikiText: toHtml()

in src/components/wiki/youtrack-wiki.tsx [73:122]


              wikiText: toHtml(node),
              onIssueIdTap: this.handleLinkPress,
            }),
          )
        }
      >
        {showMoreInlineText}
      </Text>
    );
  };

  getLanguage(node: Record<string, any>): string {
    return (node?.attribs?.class || '').split('language-').pop();
  }

  renderNode = (
    node: Record<string, any>,
    index: number,
    siblings: Record<string, any>,
    parent: Record<string, any>,
    defaultRenderer: (arg0: any, arg1: any) => any,
  ) => {
    const {imageHeaders, attachments = [], renderFullException} = this.props;
    const wikiNodeType = nodeHasType(node);

    const getCode = () =>
      node.children[0] && node.children[0].name === 'code'
        ? node.children[0]
        : node;

    switch (true) {
      case wikiNodeType.textOrNewLine ||
        wikiNodeType.expandCollapseToggle ||
        (wikiNodeType.exceptionTitle && !renderFullException):
        return HTML_RENDER_NOTHING;

      case wikiNodeType.exception && !renderFullException:
        return this.renderShowFullExceptionLink(node, index);

      case wikiNodeType.checkbox:
        return (
          <Text key={`checkbox-${node.attribs['data-position']}`}>
            {'checked' in node.attribs ? '✓' : '☐'}
          </Text>
        );

      case wikiNodeType.code:
        return (
          <Text key={index}>
            {renderWikiCode(