最後に使用を中止しました。バグが多すぎて修正する時間がありません..とにかく、保存したテキストを改行で正しく表示するために行ったことは次のとおりです(保存する前にソースが適切かどうかを確認してください)この「ハック」を使用する予定がある場合は、データベースに送信してください)
$(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\>'));
});