Cannot reproduce Editor miss-handles safari detection with copy & paste


Well-known member
Affected version
I've had reports from users since updating to XF2.2.6 that the editor on copy & paste unexpectedly consuming newlines.

I can replicate this if using Chrome/Edge and selecting a Safari-using device.

Using this as a source;

It can be from Chrome or Safari, but pasting it into Safari or Chrome-emulating-Safari and the new line between the two sentences is stripped. While it is preserved for Chrome/Edge=>Chrome/Edge
Last edited:
According to safari dev tools; the copy & paste has the mime types; text/html;text/plain;

Digging into the minified js;
/text/html/.test(c) && !b.browser.safari ? v = a.clipboardData.getData("text/html") : /text/rtf/.test(c) && b.browser.safari ? v = q : /public.rtf/.test(c) && b.browser.safari && (v = a.clipboardData.getData("text/rtf"))

For safari this will skip text/html copy & paste :(
Adding this appears to mitigate the copy&paste behaviour not working as expected;
$(document).on('editor:init', function(event, ed, xfEditor) {
    ed.browser.safari = 0;
This seems to work fine these days without any particular patches. Let me know if this isn't the case.
Top Bottom