Import

import-markdown.ts
import { NuiMarkdown } from '@needless-ui/angular/markdown';

NuiMarkdown

Renders Markdown as elements.

Selector
nui-markdown
NuiMarkdown: Properties
NameTypeDefaultDescription
textInputstring''The Markdown.
streamingInputbooleanfalseThe text is still arriving.
headingLevelInputnumber3The level of a # heading. Deeper ones follow, up to 6.
imagesInputbooleanfalseShows images. Otherwise their text links to them, since an image can track.
labelsInputPartial<NuiMarkdownLabels>The copy button’s texts and the like, to translate.
codeTemplateInputTemplateRef | nullnullA code block template from elsewhere, such as a chat that holds this one.

NuiMarkdownCode

Draws code blocks. The context holds the code, lang, and open while the block is still arriving.

Selector
ng-template[nuiMarkdownCode]

nuiParseMarkdown

The parser and its helpers, for use without the component.

nuiParseMarkdown: Properties
NameTypeDefaultDescription
nuiParseMarkdownMethod(text, { streaming? }) => NuiMarkdownBlock[]The tree of blocks and inlines the component draws.
nuiMarkdownToTextMethod(text) => stringThe plain text, a line per block, to announce or preview.
nuiSafeUrlMethod(url) => booleanWhether a link goes to a web, mail or phone address.