getTextContent
Gets the content written in Synap Editor as text.
Parameters:
<table> <thead> <tr><th>Name</th><th>Type</th><th>Attribute</th><th>Description</th></tr> </thead> <tbody> <tr> <td><code>options</code></td> <td>Object</td> <td>emoji</td> <td>'htmlcode': If there are emojis, converts them to HTML Character Code in�format.'unicode': If there are emojis, converts them to Unicode in\u0000format.'remove': If there are emojis, removes them from the text.
Return:
| Type | Description |
|---|---|
| String | The text written in the editor. |
Example:
var textContent = editor.getTextContent();
if (textContent.trim() !== '') {
// Checks whether the editor's text content consists only of whitespace; only gets HTML when text content exists.
html = editor.getPublishingHtml();
}
// emoji option
editor.getTextContent({
emoji: 'htmlcode'
});