Fixed quotes being wrapped inside <p /> which causes unwanted space
authorAlexander Ebert <ebert@woltlab.com>
Sun, 14 Dec 2014 01:44:14 +0000 (02:44 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 14 Dec 2014 01:44:14 +0000 (02:44 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index e89b6c581c76e0a5d2eee85c38413d73fa0de400..6294a6cb78d874c35115324d40118b3d09ae4677 100644 (file)
@@ -1010,6 +1010,11 @@ RedactorPlugins.wbbcode = function() {
                                }
                        }
                        
+                       // remove <p> wrapping a quote
+                       data = data.replace(/<p><blockquote/g, '<blockquote');
+                       data = data.replace(/<\/blockquote><\/p>/g, '</blockquote>');
+                       
+                       console.debug(data);
                        WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'afterConvertToHtml', { data: data });
                        
                        return data;
@@ -1592,6 +1597,11 @@ RedactorPlugins.wbbcode = function() {
                                        $tagName = 'DIV';
                                }
                                
+                               console.debug(referenceElement);
+                               console.debug(target);
+                               console.debug(referenceElement[target]);
+                               console.debug("");
+                               
                                // no previous/next element or it is not a <p> (default) or <div> (within quotes)
                                if (referenceElement[target] === null || referenceElement[target].tagName !== $tagName) {
                                        $('<' + $tagName + '>' + this.opts.invisibleSpace + '</' + $tagName + '>')[(target === 'previousElementSibling' ? 'insertBefore' : 'insertAfter')](referenceElement);