Skip to content

pantoken-root / renderers/tinymce/src / buildIconMarkup

Function: buildIconMarkup() ​

buildIconMarkup(icon): string

The decorative icon markup retained in editor content after a picker selection. A zero-width space keeps the span from being genuinely empty — TinyMCE's schema strips empty inline elements on setContent() (e.g. toggling from source view back to WYSIWYG), which would otherwise silently delete this CSS-painted glyph. contenteditable="false" makes TinyMCE treat it as a selectable, non-editable object (fake-selection painting, backspace-to-delete, and the context toolbar registered in lib/icon-context-toolbar.ts) rather than plain inline text.

Parameters ​

icon ​

TaggedIcon

Returns ​

string