ReadonlypreviewLabel shown above the WYSIWYG preview in source mode.
Both strategies use 'Preview'.
ReadonlysourceLabel shown on the source-mode toggle button.
HTML strategy: 'Edit HTML source'
Markdown strategy: 'Edit Markdown source'
Applies a link result (from the link dialog) at the saved selection position.
URL + display text from the dialog
The <a> element being edited, or
null for a new link
The selection range saved before the dialog opened
Creates a placeholder chip DOM element for insertion into the editor.
Takes a raw value string and returns HTML suitable for
inserting into the editor's innerHTML.
{{key}} tokens to chip markup.{{key}} tokens.Executes a formatting action (e.g. bold, heading, list).
For HTML this maps to document.execCommand.
For Markdown this wraps the selection with the appropriate
syntax characters.
true if the action was handled synchronously and
the caller should sync + refresh, or false if the action
is deferred (e.g. link dialog).
Handles a paste event, inserting cleaned content into the editor.
The implementation should call event.preventDefault() and
manage insertion itself.
Queries the current formatting state at the caret position and returns the set of active format actions.
Sanitises HTML before it is written to the editor DOM.
Called by the component whenever content is rendered into the WYSIWYG area (paste, value binding, source toggle).
Reads the editor element and returns the serialised output string.
{{key}} tokens, returns innerHTML.{{key}} tokens.
Strategy interface that encapsulates all format-specific editing logic.
The rich-text editor component delegates to an implementation of this interface for every operation that differs between HTML and Markdown (or any future format).
Implementations are plain classes — not Angular injectables — because they are instantiated directly by the component based on the
modeinput.