froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.28k stars 671 forks source link

ampersand in link #4592

Closed kaniansky closed 1 month ago

kaniansky commented 1 year ago
Expected behavior.

Ampersandin a link is preserved and link is linkified

Actual behavior.

Ampersand is changed into HTML entity & and only part of the link is linkified

Steps to reproduce the problem.

paste a link with ampersand (E.g.: https://www.google.com/search?q=froala+ampersand+bug&oq=bla&sourceid=chrome) from browser URL bar into Froala Editor

Editor version.

4.0.17 on https://froala.com/wysiwyg-editor/examples/iframe/

OS.

Linux Mint but seems to be also on Windows 11

Browser.

Tested on Chrome

Recording.

image

DarylBuckle commented 1 year ago

I've been having the same issue after upgrading from 4.0.16 to 4.0.17. It wasn't an issue in 4.0.16. Also tried 4.0.18 and 4.0.19 and it's still a problem.

It's an annoying one for our users, and I can't roll back to 4.0.16 as we need the fix for backspace issue in iOS that's in 4.0.17. So I did a bit of digging and traced it back to this addition in 4.0.17 in both /js/froala_editor.pkgd.min.js and /js/plugins.pkgd.min.js;

&&!l.$el[0].getAttribute("plainpaste")

Deleting this condition from both files (which reverts this line back to how it was in 4.0.16) fixes this issue. Obviously, it's not ideal as no doubt this was put in to fix a different issue. But this issue seems like it's far more annoying than whatever issue this code was added in to fix.

Hopefully this helps anyone else who needs a workaround for the time being. Just find and replace both occurrences of the above text with empty string.

earshinov commented 4 months ago

Seems to be fixed in 4.2.0. Here is a JSFiddle: https://jsfiddle.net/earshinov/rut06p8L/3/. Can someone confirm?

earshinov commented 1 month ago

Now using Froala 4.2.1 in our app, the issue is no longer there. @kaniansky , please consider closing the issue.