Function useMarkdownRendering

  • This hook uses markdown-it directly to render markdown. The reason to use markdown-it directly is that the MarkdownRenderer is overridden by theia with a monaco version. This monaco version strips all html tags from the markdown with empty content. This leads to unexpected behavior when rendering markdown with html tags.

    Parameters

    • markdown: string | MarkdownString

      the string to render as markdown

    • skipSurroundingParagraph: boolean = false

      whether to remove a surrounding paragraph element (default: false)

    Returns MutableRefObject<null | HTMLDivElement>

    the ref to use in an element to render the markdown