xhtml4pubdoc

2.11.5 버전부터 지원합니다.

공문서(정부 전자문서)용 필터를 적용한 HTML 문자열을 반환합니다.

1.00

매개변수

이름타입속성설명
optionsObject[ 선택 사항 ] { applyFirstTextStyle: string[] } 형태의 Object. 아래 options 참고.첫 번째 글자를 감싼 태그(<span>)에 스타일이 있으면, 해당 스타일을 문단(<p>) 태그에 적용합니다. 아래 options 참고.

options

{
    applyFirstTextStyle: string[]
}

[ 선택 사항 ] 첫 번째 글자를 감싼 태그(<span>)에 스타일이 있으면, 해당 스타일을 문단(<p>) 태그에 적용합니다.

예) [ 'fontSize', 'fontFamily', 'color', 'backgroundColor', 'bold', 'italic', 'strike', 'underline' ]

반환값

타입설명
stringHTML 문자열입니다.

예시

var pubdoc = editor.xhtml4pubdoc();
var pubdocOption = editor.xhtml4pubdoc({ applyFirstTextStyle: ['fontSize', 'color'] }); // with options applied

원본

1.00

HTML 코드:

<div class="se-contents" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt; line-height: 1.2;">
    <p style="margin: 16px 0px; display: block; overflow-wrap: break-word;"><span style="font-weight: bold; font-style: italic; text-decoration: underline line-through; font-size: 16pt; color: rgb(246, 179, 127);">Synapsoft</span><span style="font-style: italic;"> Web Editor</span></p>
</div>
editor.xhtml4pubdoc()editor.xhtml4pubdoc(['fontSize', 'color'])
Without optionOption applied

editor.xhtml4pubdoc()

HTML 코드:

<p style="margin: 16px 0px; display: block; overflow-wrap: break-word;">
    <u><b><i>Synapsoft</i></b></u>
    <i> Web Editor</i>
</p>

editor.xhtml4pubdoc(['fontSize', 'color'])

HTML 코드:

<p style="font-size: 16pt; color: rgb(246, 179, 127); margin: 16px 0px; display: block; overflow-wrap: break-word;">
    <u><b><i>Synapsoft</i></b></u>
    <i> Web Editor</i>
</p>