---
url: /api/renderers/tinymce/src/functions/buildIconMarkup.md
---
[pantoken-root](../../../../index.md) / [renderers/tinymce/src](../index.md) / 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 noneditable object (fake-selection painting, backspace-to-delete, and the context
toolbar registered in `lib/icon-context-toolbar.ts`) instead of plain inline text.

## Parameters

### icon

[`TaggedIcon`](../interfaces/TaggedIcon.md)

## Returns

`string`
