Home   Pricing

Enter Key Tag

Rich Text Editor can be configured to define the behaviour of the ENTER KEY. You use <p>, <br /> or <div> tags when you press enter. In either mode <br> tags can be created by using shift+enter.

By default enter key inserts <div>.

Use <p> tags on enter keypress instead of <div>tags.
Use <br> tags on enter keypress instead of <div>tags.

Demo Code:

import { createRichTextEditor } from "ts-rich-text-editor";

// Enter key inserts <div>
const editor1 = await createRichTextEditor("#div_editor1", {
  enterKeyTag: "div",
}, {
  basePath: "/richtexteditor",
});

// Enter key inserts <p>
const editor2 = await createRichTextEditor("#div_editor2", {
  enterKeyTag: "p",
}, {
  basePath: "/richtexteditor",
});

// Enter key inserts <br>
const editor3 = await createRichTextEditor("#div_editor3", {
  enterKeyTag: "br",
}, {
  basePath: "/richtexteditor",
});
{enterKeyTag : "div"}
{enterKeyTag : "p"}
{enterKeyTag : "br"}