Skip to main content

toHTML

Stentor API Reference


Stentor API Reference / stentor-utils/src / toHTML

Function: toHTML()

toHTML(input, props?): string

Defined in: packages/stentor-utils/src/markdown.ts:21

Converts a markdown string to HTML.

Supported markdown is Github

It also decodes HTML entities and cleans dirty dangerous tags.

All <a> hyperlink tags have target="_blank" added to open the URLs in a new window.

Parameters​

input​

string

String with markdown

props?​

Optional props to pass that influence the behavior.

allowedTags?​

string[]

Returns​

string

String with HTML, wrapped with

tags.