날씨위젯
최종편집 2024.07.20 (토)
워드프레스 케이보드에서 미리 입력해둔 값이 있을 경우 br 태그로 문장이 끝납니다.

그런데 수정을 하면 그 Br 태그가 중복으로 계속 생겨나는 버그가 있었습니다.

summernote.0.8.18 버전에서 발생하는 문제였고, 수정이 되었다는 글을 봤지만 여전히 해당 문제는 고쳐지지 않은 상태였습니다.
*Kboard Summernote 버전 확인하는 방법

/www/wp-content/plugins/kboard/assets/summernote/summernote-lite.js




케이보드 Summernote BR 태그 중복으로 발생하는 문제 수정하는 방법

/www/wp-content/plugins/kboard/template/js/script.js
if(kboard_current.use_editor == 'snote'){ // summernote
jQuery('.summernote').each(function(){
var height = parseInt(jQuery(this).height());
var placeholder = jQuery(this).attr('placeholder');
var lang = 'en-US';

if(kboard_settings.locale == 'ko_KR'){
lang = 'ko-KR';
}
else if(kboard_settings.locale == 'ja'){
lang = 'ja-JP';
}

jQuery(this).summernote({
toolbar: [
//['style', ['style']],
['fontsize', ['fontsize']],
['font', ['bold', 'italic', 'underline', 'clear']],
['fontname', ['fontname']],
['color', ['color']],
// ['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
// ['table', ['table']],
// ['insert', ['link', 'video', 'hr']],
// ['view', ['fullscreen', 'codeview']],
// ['help', ['help']]
],
//fontNames: ['Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande', 'Tahoma', 'Times New Roman', 'Verdana', 'Nanum Gothic', 'Malgun Gothic', 'Noto Sans KR', 'Apple SD Gothic Neo'],
//fontNamesIgnoreCheck: ['Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande', 'Tahoma', 'Times New Roman', 'Verdana', 'Nanum Gothic', 'Malgun Gothic', 'Noto Sans KR', 'Apple SD Gothic Neo'],
//fontSizes: ['8','9','10','11','12','13','14','15','16','17','18','19','20','24','30','36','48','64','82','150'],
lang: lang,
height: height,
placeholder: placeholder
});
});
$(".summernote").on("summernote.enter", function(we, e) {
$(this).summernote("pasteHTML", "<br><br>");
e.preventDefault();
});
}
로그인하세요.