Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

사이냅에디터에서는 API를 이용한 내용 편집을 위해 APIModel을 제공하고 있습니다.


APIModel Class는 편집용 Model을 가져오는데 사용되는 get method를 제공하고 있습니다.


get


Parameters:

Name

Type

Attribute

Description

options

Object
  • emoji
    • 'htmlcode': 이모지가 있는 경우 � 형식의 HTML Character Code 로 변환
    • 'unicode': 이모지가 있는 경우 \u0000 형식의 Unicode 로 변환
    • 'remove': 이모지가 있는 경우 텍스트에서 이모지를 제거


Return:

TypeDescription
String에디터에서 작성된 텍스트



Example:

var textContent = editor.getTextContent();
if(textContent.trim() !== '') { // 에디터 텍스트 컨텐츠가 공백문자로만 있을 경우를 판단하여 없을경우에만 html을 가져온다.
	html = editor.getPublishingHtml();
}


// emoji 옵션
editor.getTextContent({
	emoji: 'htmlcode'
});





APIModel은 아래와 같이 구성되어 있습니다.

상위 ModelModel설명
Element


ListItem

Paragraph

Table

TableRow

TableCell

TextRun


  • No labels