Theia API Documentation v1.74.0
    Preparing search index...
    • 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.

      Moreover, we want to intercept link clicks to use the Theia OpenerService instead of the default browser behavior.

      Parameters

      • markdown: string | MarkdownString

        the string to render as markdown

      • openerService: OpenerService

        the service to handle link opening

      • skipSurroundingParagraph: boolean = false

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

      • OptionaleventHandler: DeclaredEventsEventListenerObject

        handleEvent will be called by default for click events and additionally for all events enumerated in DeclaredEventsEventListenerObject.handledEvents. If handleEvent returns true, no additional handlers will be run for the event.

      • blockExternalResourceLoading: boolean = true

        whether external URL resources should be blocked until explicitly allowed (default: true). Trusted content authored by the user (e.g. their own chat requests) can pass false to render such resources directly. Active embedded content (iframes, frames, objects, embeds) is always blocked regardless of this flag.

      Returns MutableRefObject<null | HTMLDivElement>

      the ref to use in an element to render the markdown