Unified behavior for newline after [/quote] tag
authorAlexander Ebert <ebert@woltlab.com>
Wed, 21 Jan 2015 00:23:54 +0000 (01:23 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 21 Jan 2015 00:23:54 +0000 (01:23 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js

index 1aa841b9ac05b234bf5adcc06c2a311a0ffc88bd..a4cee4264aa3dea10b20ceff32049be17eb24869 100644 (file)
@@ -256,7 +256,13 @@ RedactorPlugins.wutil = function() {
                submit: function() {
                        if (this.wutil.inWysiwygMode()) {
                                this.code.startSync();
-                               this.$textarea.val($.trim(this.wbbcode.convertFromHtml(this.$textarea.val())));
+                               
+                               var $text = $.trim(this.wbbcode.convertFromHtml(this.$textarea.val()));
+                               
+                               // remove linebreak after [/quote]
+                               $text = $text.replace(/\[\/quote\]\n/g, '[/quote]');
+                               
+                               this.$textarea.val($text);
                        }
                        
                        this.wutil.autosavePurge();