Rich Text Editors (RTE)
Rich Text Editors (RTEs) are iframes/divs whose designMode or contentEditable property is set to true. Such components allow input of text and formatting them (making text bold, inserting images etc.)
Rich Text Editors do not respond to regular events and need to be handled specifically.
Identification
Section titled “Identification”RTE Fetch APIs
Section titled “RTE Fetch APIs”Rte Text
Section titled “Rte Text”Modes Browser
Parameters
| Name | Type | Description |
|---|---|---|
$el | HTML DOM element | Element which is content editable (eg. _rte(0)) |
Returns
string | Text inside a rich text editor (without the html formatting) |
Raw script
// get the rich text editor's text contentvar $rteText = _rteText(_rte("rteId"));// $rteText may look like "Hi there"Sahi Pro Classic API _rteText
Rte HTML
Section titled “Rte HTML”Modes Browser
Parameters
| Name | Type | Description |
|---|---|---|
$el | HTML DOM element | Element which is content editable (eg. _rte(0)) |
Returns
string | HTML content inside a rich text editor (without the html formatting) |
Raw script
// get the rich text editor's HTML contentvar $rteHTML = _rteHTML(_rte("rteId"));// $rteHTML may look like "Hi <b>there</b>"Sahi Pro Classic API _rteHTML
RTE Action APIs
Section titled “RTE Action APIs”Rte Write
Section titled “Rte Write”Modes Browser
Replaces the content of the RTE with given HTML. Note that this does not simulate all events like other Sahi APIs. Rte Write only replaces the content of the iframe.
Parameters
| Name | Type | Description |
|---|---|---|
$rte | HTML DOM element | RTE to write into |
$html | string | html to write |
Raw script
_rteWrite(_rte("editor"), "Hi <b>user</b>");Sahi Pro Classic API _rteWrite

