From db8aa6fc2d70ad3c826e623223d3f93abc9abcf5 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 29 Jun 2017 19:43:19 +0900 Subject: [PATCH] Always treat the textarea skin as producing HTML content, because it automatically generates HTML --- modules/editor/skins/textarea/editor.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/editor/skins/textarea/editor.html b/modules/editor/skins/textarea/editor.html index 15732d317..437b89ef4 100644 --- a/modules/editor/skins/textarea/editor.html +++ b/modules/editor/skins/textarea/editor.html @@ -28,9 +28,24 @@ // Save edited content textarea.on("change", function() { - content_input.val("

" + String($(this).val()).escape().replace(/\r?\n/, "

\n

") + "

"); + content_input.val("

" + String($(this).val()).escape().replace(/\r?\n/g, "

\n

") + "

"); }); + // Add use_editor and use_html fields to parent form. + var parentform = $('#textarea_instance_{$editor_sequence}').parents('form'); + var use_editor = parentform.find("input[name='use_editor']"); + var use_html = parentform.find("input[name='use_html']"); + if (use_editor.size()) { + use_editor.val("Y"); + } else { + parentform.append(''); + } + if (use_html.size()) { + use_html.val("Y"); + } else { + parentform.append(''); + } + });