// use stored editor contents
var $content = $.trim(this.wutil.getOption('woltlab.originalValue'));
if ($content.length) {
- this.wutil.replaceText($content, false);
+ this.wutil.replaceText($content);
// ensure that the caret is not within a quote tag
this.wutil.selectionEndOfEditor();
// [s]
data = data.replace(/\[s\]([\s\S]*?)\[\/s]/gi, (function(match, content) {
- return this.wbbcode._expandFormatting(content, '<strike>', '</strike>');
+ return this.wbbcode._expandFormatting(content, '<del>', '</del>');
}).bind(this));
// [sub]
* Replaces the current content with the provided value.
*
* @param string value
- * @param boolean addNewlines
*/
- replaceText: function(value, addNewlines) {
+ replaceText: function(value) {
var $document = $(document);
var $offsetTop = $document.scrollTop();
var $wasInWysiwygMode = false;
$wasInWysiwygMode = true;
}
- if (addNewlines !== false) {
- value = this.wutil.addNewlines(value);
- }
-
+ value = this.wutil.addNewlines(value);
this.$textarea.val(value);
if ($wasInWysiwygMode) {
continue;
}
+ if ($child.innerHTML === "\n") {
+ $child.parentElement.removeChild($child);
+
+ $i--;
+ $length--;
+
+ continue;
+ }
+
if ($child.textContent.length > 0) {
// element is non-empty
continue;