OGE logoOGE

Rich Text Editor

A rich-text editor whose value is sanitized HTML. The editing surface is a contenteditable element, but the browser never edits it on its own: every keystroke, toolbar click and paste becomes a command on the editor's own document model, and the DOM is rendered from that model. There is no document.execCommand — deprecated, different in every engine, and the reason most editors produce different markup per browser — so the output is the same everywhere and undo/redo is the editor's own history.

The same allowlist parser reads the bound value, every paste (Word and Google Docs markup is cleaned up on the way in) and insertHtml(). Scripts, event handlers, unknown attributes and unsafe URLs cannot survive it; its one DOMParser call runs behind the oge-ui#editor Trusted Types policy, and the live DOM is built with createElement, never innerHTML. Full API reference →

contenteditable sanitized HTML markdown shortcuts forms

Getting started

Type, select and format. The box under the editor is the live value — sanitized HTML, the empty string when the document is empty.

[(value)] placeholder hint
Description

Hello world

Try Ctrl+B, Ctrl+K, or type “# ” at the start of a line.
<p>Hello <strong>world</strong></p>

Toolbar and custom tools

Built-in tool names, separators and your own tools in any order. Narrow the window: tools that do not fit move into the overflow menu, toggles keep their check mark there.

toolbar OgeEditorCustomTool overflow
Release notes

1.2.0

  • New rich-text editor

Keyboard and markdown

Every shortcut is in its tool’s tooltip and aria-keyshortcuts. Start a line with # , - , 1. or > ; Tab and Shift+Tab nest list items.

shortcuts markdownShortcuts headingLevels
Meeting notes


Ctrl/⌘ + B, I, U Bold, italic, underline
Ctrl/⌘ + Shift + X Strikethrough
Ctrl/⌘ + K Link dialog
Ctrl/⌘ + Z, Y Undo, redo
Ctrl/⌘ + Alt + 0 … 6 Paragraph, heading 1–6
Ctrl/⌘ + Shift + 7, 8 Numbered, bulleted list
Shift + Enter Line break inside the block

The link and image tools open the overlay’s prompt dialog. A javascript: address is refused, and a bare domain typed into the dialog gets https:// instead of becoming a relative link.

insertLink() insertImage() openLinkDialog()
Article

Read the docs.

Paste and sanitizing

Paste from Word, Google Docs or a web page: formatting the editor knows survives, everything else is dropped. The second box shows the sanitizer applied to hostile HTML.

pasteMode (pasting) ogeSanitizeEditorHtml
Paste here


<p>Hi there<img src="x" alt=""></p>

Angular forms

Reactive forms, Signal Forms and plain [(value)] bind the same component. ogeEditorMaxLength() counts text, not markup.

formControl ogeEditorMaxLength maxLength
Summary


0 / 200

valid: false

Read-only, sizing and counter

Read-only keeps the text focusable and selectable; disabled takes the editor out of the Tab order. Drag the corner to resize.

readonly disabled resizable counter
Terms

Terms

By using this service you agree to everything.

51 characters · 9 words

Configuration

App-wide defaults and strings through provideOgeEditorConfig() (also covered by provideOgeLocale()), and the Trusted Types policy name a strict CSP lists.

provideOgeEditorConfig Trusted Types