사이냅에디터에서는 API를 이용한 내용 편집을 위해 APIModel을 제공하고 있습니다.
APIModel Class는 편집용 Model을 가져오는데 사용되는 get method를 제공하고 있습니다.
get
Parameters:
Name | Type | Attribute | Description |
---|---|---|---|
options | Object |
|
Return:
Type | Description |
---|---|
String | 에디터에서 작성된 텍스트 |
Example:
var textContent = editor.getTextContent(); if(textContent.trim() !== '') { // 에디터 텍스트 컨텐츠가 공백문자로만 있을 경우를 판단하여 없을경우에만 html을 가져온다. html = editor.getPublishingHtml(); } // emoji 옵션 editor.getTextContent({ emoji: 'htmlcode' });
APIModel은 아래와 같이 구성되어 있습니다.
상위 Model | Model | 설명 |
---|---|---|
Element | ||
ListItem | ||
Paragraph | ||
Table | ||
TableRow | ||
TableCell | ||
TextRun |