[Rt-commit] rt branch 5.0/richtext-signature-blockquote-spacing created. rt-5.0.2beta1-18-g3bd6f73b0c

BPS Git Server git at git.bestpractical.com
Thu Sep 9 17:32:45 UTC 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/richtext-signature-blockquote-spacing has been created
        at  3bd6f73b0ca678e897734aea2f3e084824e7335e (commit)

- Log -----------------------------------------------------------------
commit 3bd6f73b0ca678e897734aea2f3e084824e7335e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Sep 9 13:19:48 2021 -0400

    Updates to align with new signature blank lines

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 859ceacd40..3f20b66ea3 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1237,6 +1237,8 @@ sub StripContent {
     # massage content to easily detect if there's any real content
     $content =~ s/\s+//g; # yes! remove all the spaces
     if ( $html ) {
+        # Remove the blank line added for signatures
+        $content =~ s!<p> </p>!!g;
         # remove html version of spaces and newlines
         $content =~ s! !!g;
         $content =~ s!<br/?>!!g;
diff --git a/t/web/signatures.t b/t/web/signatures.t
index 72f9bb1353..e4cd209659 100644
--- a/t/web/signatures.t
+++ b/t/web/signatures.t
@@ -132,26 +132,26 @@ my $quote = '<div class="gmail_quote">Someone wrote:<br />'
 subtest "HTML, no reply" => sub {
     template_is(
         qw/HTML/,
-        '<br /><p>-- <br />Signature one<br />Signature two</p>',
+        '<p> </p><p>-- <br />Signature one<br />Signature two</p>',
     ) };
 
 subtest "HTML, no reply, before quote (which is irrelevant)" => sub {
     template_is(
         qw/HTML BeforeQuote/,
-        '<br /><p>-- <br />Signature one<br />Signature two</p>',
+        '<p> </p><p>-- <br />Signature one<br />Signature two</p>',
     ) };
 
 subtest "HTML, reply" => sub {
     template_is(
         qw/HTML Quote/,
-        $quote.'<br /><p>-- <br />Signature one<br />Signature two</p>',
+        $quote.'<p> </p><p>-- <br />Signature one<br />Signature two</p>',
     ) };
 
 subtest "HTML, reply, before quote" => sub {
     template_is(
         qw/HTML Quote BeforeQuote/,
-        '<br /><p>-- <br />Signature one<br />Signature two</p>'
-            . "<br />" . $quote,
+        '<p> </p><p>-- <br />Signature one<br />Signature two</p>'
+            . "<p> </p>" . $quote,
     ) };
 
 

commit c6b0f9d14f061c135cb5d4c86987b4aab8d5499a
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Sep 9 11:47:38 2021 -0400

    Convert default spacing to block level p tags
    
    In RT 5, we removed the custom config.enterMode setting of
    CKEDITOR.ENTER_BR in favor of the default ENTER_P setting
    since the CKEditor documentation strong discourages customizing
    this option.
    
    With this default setting, CKEditor wants content to be contained
    in block level elements, so it converts the <br /> spacing around
    signatures to <p> </p> and in doing so ends up adding an
    extra line after top-quoted signatures that isn't intended.
    
    Convert the default spacing to <p> </p> explicitly to
    avoid the unexpected conversion in the editor. This allows us
    to retain the desired spacing originally added in 9df4d3387
    and do so in a way that is compatible with the CKEditor
    configuration change.

diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index 1c199816a6..ce985aa51b 100644
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -85,14 +85,14 @@ if ( $IncludeSignature and $signature =~ /\S/ ) {
         $signature =~ s/"/"/g;  # "//;
         $signature =~ s/'/'/g;   # '//;
         $signature =~ s{\n}{<br />}g;
-        $signature = "<br /><p>-- <br />$signature</p>";
+        $signature = "<p> </p><p>-- <br />$signature</p>";
     } else {
         $signature = "\n\n-- \n". $signature . "\n";
     }
 
     if ($message =~ /\S/) {
         if (RT->Config->Get('SignatureAboveQuote', $session{CurrentUser})) {
-            $signature .= $Type eq 'text/html' ? "<br />" : "\n";
+            $signature .= $Type eq 'text/html' ? "<p> </p>" : "\n";
         } else {
             $signature = ($Type eq 'text/html' ? "" : "\n") . $signature;
         }

commit 02172eb80eb89ef20e72a763079f443ed2e14870
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Sep 9 11:40:21 2021 -0400

    Remove commented out removeButtons configuration

diff --git a/share/static/RichText/config.js b/share/static/RichText/config.js
index f3d4cd6c73..1a7824a097 100644
--- a/share/static/RichText/config.js
+++ b/share/static/RichText/config.js
@@ -26,10 +26,6 @@ CKEDITOR.editorConfig = function( config ) {
 
     	config.removeButtons = 'Underline,Subscript,Superscript,About,Link,Image,HorizontalRule,SpecialChar,Source,DocProps,Unlink,Anchor,Strike,Cut,Copy,Outdent,Indent';
 
-	// Remove some buttons provided by the standard plugins, which are
-	// not needed in the Standard(s) toolbar.
-//	config.removeButtons = 'Underline,Subscript,Superscript';
-
 	// Simplify the dialog windows.
 	config.removeDialogTabs = 'image:advanced;link:advanced';
     if ( RT.Config.WebDefaultStylesheet.match(/dark/) ) {

commit 5c0bfa959d07178caabcb8914d94b1dba840653f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Sep 9 11:30:53 2021 -0400

    Allow div as a format tag for CKEditor
    
    The format_tags configuration was originally set to simplify the
    format menu in the editor, but excluding the div tag also caused
    the editor to not use it when showing quoted content, breaking
    the blockquote tags we add there.
    
    The default format_tags configuration adds only a few more
    format options, which doesn't really make the Format menu any less
    usable, so remove the custom configuration and use the default,
    which also restores div and fixes the blockquote issue.

diff --git a/share/static/RichText/config.js b/share/static/RichText/config.js
index 5c3d146bf3..f3d4cd6c73 100644
--- a/share/static/RichText/config.js
+++ b/share/static/RichText/config.js
@@ -30,9 +30,6 @@ CKEDITOR.editorConfig = function( config ) {
 	// not needed in the Standard(s) toolbar.
 //	config.removeButtons = 'Underline,Subscript,Superscript';
 
-	// Set the most common block elements.
-	config.format_tags = 'p;h1;h2;h3;pre';
-
 	// Simplify the dialog windows.
 	config.removeDialogTabs = 'image:advanced;link:advanced';
     if ( RT.Config.WebDefaultStylesheet.match(/dark/) ) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list