스마트에디터 줄바꿈 시 P 태그 대신에 BR 태그로 적용
본문
스마트에디터에서 줄바꿈 하는 방법은 두 가지가 있습니다.
엔터키로 하는 방법과 쉬프트+엔터로 하는 방법이 있는데
엔터키는 <P> 태그가 적용되고 쉬프트+엔터는 <BR> 태그로 적용됩니다.
엔터키로 줄바꿈 해도 <P> 태그 대신에 <BR> 태그로 변경해서 적용하는 방법을 살펴보겠습니다.
1. plugin/editor/smarteditor2/js/smarteditor2.min.js 파일 수정
문서 편집기로 검색어를 sLineBreaker="P" 로 검색하면 아래 코드가 보이는데
{name:"SE_WYSIWYGEnterKey",$init:function(a){if(a=="BR"){this.sLineBreaker="BR"}else{this.sLineBreaker="P"}sLineBreaker="P"
여기를 BR로 변경
sLineBreaker="BR"
2. plugin/editor/smarteditor2/js/service/SE2BasicCreator.js 파일 수정
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGEnterKey("P"));
위 코드를 찾은 후 마찬가지로 BR로 변경
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGEnterKey("BR"));
수정 후 반영이 안 된다면 브라우저 캐시 삭제 후 새로고침
출처 : https://gnustudy.com/bbs/board.php?bo_table=gnu_tip&wr_id=262
댓글목록
등록된 댓글이 없습니다.