getTextContent

Synap Editor에 작성된 내용을 텍스트로 가져옵니다.

매개변수

이름타입속성설명
optionsObjectemoji- 'htmlcode': 이모지가 있으면 � 형식의 HTML 문자 코드로 변환합니다. - 'unicode': 이모지가 있으면 \u0000 형식의 유니코드로 변환합니다. - 'remove': 이모지가 있으면 텍스트에서 제거합니다.

반환값

타입설명
String에디터에 작성된 텍스트입니다.

예시

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'
});