Jump to content

Recommended Posts

Posted

In firefox, pressing enter twice does not break out of quotes. This did used to work, and still does on Chrome, although I'm not sure why it did given the code involved was last changed 4 and 10 years ago in ipsquote and ckeditor respectively.

It seems to be because the regex that removes the bogus <br/> does not account for the type="_moz" attribute that is added when running in firefox.

Here's a fix that seems to work for me:

diff --git a/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js b/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js
index b26116dd..9404a002 100644
--- a/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js
+++ b/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js
@@ -166,7 +166,7 @@ CKEDITOR.plugins.add( 'ipsquote', {
                                    var paragraphContent        = selectedElement.getHtml();
 
                                    // We are going to ignore <br> tags, but only one (if there are more than one don't ignore)
-                                   paragraphContent            = paragraphContent.replace( /\<br\>/, '' );
+                                   paragraphContent            = paragraphContent.replace( /\<br( [^>]*)?\>/, '' );
 
                                    // Ignore empty span tags
                                    paragraphContent            = paragraphContent.replace( /\<span.*?\>\s*?\<\/span\>/g, '' );

Originally reported to me by a user.

Posted

Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.

 

Posted (edited)
18 hours ago, Colonel_mortis said:

In firefox, pressing enter twice does not break out of quotes. This did used to work, and still does on Chrome, although I'm not sure why it did given the code involved was last changed 4 and 10 years ago in ipsquote and ckeditor respectively.

It seems to be because the regex that removes the bogus <br/> does not account for the type="_moz" attribute that is added when running in firefox.

Here's a fix that seems to work for me:

diff --git a/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js b/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js
index b26116dd..9404a002 100644
--- a/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js
+++ b/applications/core/dev/ckeditor/plugins/ipsquote/plugin.js
@@ -166,7 +166,7 @@ CKEDITOR.plugins.add( 'ipsquote', {
                                    var paragraphContent        = selectedElement.getHtml();
 
                                    // We are going to ignore <br> tags, but only one (if there are more than one don't ignore)
-                                   paragraphContent            = paragraphContent.replace( /\<br\>/, '' );
+                                   paragraphContent            = paragraphContent.replace( /\<br( [^>]*)?\>/, '' );
 
                                    // Ignore empty span tags
                                    paragraphContent            = paragraphContent.replace( /\<span.*?\>\s*?\<\/span\>/g, '' );

Originally reported to me by a user.

I've been with Invision for 14 months and double-enter with FireFox has never worked for me. For this reason, I usually use Edge.

It did not occur to me that there might be a fix for this. Hopefully it will be fixed again and I will add it to my site.

Edited by Como
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...