mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.87k stars 141 forks source link

How to output content as html #499

Closed krstivoja closed 3 months ago

krstivoja commented 3 months ago

In the preview I see HTML but output is markdown. How to fetch HTML instead of Markdown.

Help please.

<MDXEditor
        markdown={markdown}
        onChange={onChange}
        plugins={[
          headingsPlugin(),
          linkDialogPlugin(),
          listsPlugin(),
          thematicBreakPlugin(),
          toolbarPlugin({
            toolbarContents: () => (
              <>
                <UndoRedo />
                <Separator />
                <div className="mdxdropdown">
                  <BlockTypeSelect />
                </div>
                <Separator />
                <BoldItalicUnderlineToggles />
                <Separator />
                <ListsToggle />
                <Separator />
                <CreateLink />
                <InsertThematicBreak />
              </>
            ),
          }),
        ]}
      />
petyosi commented 3 months ago

That's not the purpose of this component - it's a markdown editor that's supposed to input/output markdown. You probably need something else.

krstivoja commented 3 months ago

Thanks for you supa fast reply @petyosi. I assumed since you can write html you can get it as well.

Best