Loading...
Loading...
Implement the Syncfusion Markdown Converter in React to convert Markdown text into clean HTML. Use this when converting Markdown to HTML in React, integrating a live Markdown preview with the Rich Text Editor in Markdown mode, configuring GFM or line break options, or working with MarkdownConverter.toHtml() and MarkdownConverterOptions. This skill covers the @syncfusion/ej2-markdown-converter package and Markdown Editor integration with HTML preview in React applications.
npx skill4agent add syncfusion/react-ui-components-skills syncfusion-react-markdown-converterRichTextEditorComponentRichTextEditorComponentMarkdownConverter.toHtml()@syncfusion/ej2-markdown-converter@syncfusion/ej2-react-richtexteditorMarkdownEditorToolbarImageLinkTableMarkdownConverter.toHtml()dangerouslySetInnerHTMLMarkdownConverterOptionsasyncgfmlineBreak<br>silencetoHtml()editorMode="Markdown"createdchangeactionCompleteMarkdownFormatternpm install @syncfusion/ej2-markdown-converter
npm install @syncfusion/ej2-react-richtexteditorsrc/styles.css@import '../node_modules/@syncfusion/ej2-base/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-richtexteditor/styles/material3.css';import { MarkdownConverter } from '@syncfusion/ej2-markdown-converter';
const markdown = '# Hello World\nThis is **Markdown** text.';
const html = MarkdownConverter.toHtml(markdown);
console.log(html);
// Output: <h1>Hello World</h1><p>This is <strong>Markdown</strong> text.</p>import { MarkdownConverter } from '@syncfusion/ej2-markdown-converter';
const html = MarkdownConverter.toHtml(markdownString);
document.getElementById('preview')!.innerHTML = html as string;const markdownConversion = () => {
if (mdsource?.classList.contains('e-active')) {
const htmlPreview = rteObj.element.querySelector('#' + rteObj.getID() + 'html-view') as HTMLElement;
htmlPreview.innerHTML = MarkdownConverter.toHtml(
(rteObj.contentModule.getEditPanel() as HTMLTextAreaElement).value
) as string;
}
};const html = MarkdownConverter.toHtml(markdownString, {
gfm: false,
lineBreak: true
});updateValue()| API | Type | Default | Purpose |
|---|---|---|---|
| static method | — | Converts Markdown string to HTML |
| boolean | | Async conversion for large content |
| boolean | | GitHub Flavored Markdown support |
| boolean | | Single line breaks → |
| boolean | | Suppress errors on invalid Markdown |