getTextContent
Synap Editor에서 작성된 내용을 텍스트로 가져옵니다.
Parameters:
Name | Type | Attribute | Description |
|---|---|---|---|
htmlcode | boolean | default : false | 이모지가 있는 경우 � 형식의 HTML Character Code 로 변환 |
unicode | boolean | default : false | 이모지가 있는 경우 \u0000 형식의 Unicode 로 변환 |
remove | boolean | default : false | 이모지가 있는 경우 텍스트에서 이모지를 제거 |
Return:
| Type | Description |
|---|---|
| String | 에디터에서 작성된 텍스트 |
Example:
var textContent = editor.getTextContent();
if(textContent.trim() !== '') { // 에디터 텍스트 컨텐츠가 공백문자로만 있을 경우를 판단하여 없을경우에만 html을 가져온다.
html = editor.getPublishingHtml();
}
// emoji 옵션
editor.getTextContent({
emoji: 'htmlcode'
});