끝에 그것을 사용하여 드롭, 내가 수정 시간이 없어 많은 버그가 있습니다. 어쨌든 여기에 줄 바꿈으로 올바르게 표시하려면 저장된 텍스트를 얻으려고 무엇입니까 이 "해킹"을 사용하려는 경우 원본은 db에 저장하기 전에 좋습니다)
$(document).ready(function() {
//Initialize JhtmlArea
$(".editor").htmlarea({
toolbar: [
["bold", "italic", "underline"],
["orderedList", "unorderedList"],
["link", "unlink"],
]
});
//Set id (id will be same for all instances)
$("iframe").attr("id", "editor");
// Style hack
$("#editor").contents().find('body').css({ "font-family": "MS Shell Dlg", "font-size": "12px", "font-weight": "100" });
// Finally to newlines hack
var html = $(".editor").htmlarea("toHtmlString");
// I would od something like $(".editor").htmlarea("html", "");
// But there is a bug since this function calls "pastHtml" internally
// which is a typo instead of
// "pasteHtml" so it won't work
$("#editor").contents().find('body').html("");
$(".editor").htmlarea("pasteHTML", html.replace(/\n/g, '<br\>'));
});