[wp-trac] [WordPress Trac] #41259: Editing an image link in the Editor produces one additional, empty link
WordPress Trac
noreply at wordpress.org
Tue Jul 18 11:27:11 UTC 2017
#41259: Editing an image link in the Editor produces one additional, empty link
-----------------------------------------+--------------------
Reporter: afercia | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.8.1
Component: Editor | Version: 4.8
Severity: normal | Resolution:
Keywords: has-screenshots needs-patch | Focuses:
-----------------------------------------+--------------------
Comment (by spocke):
The bug here seems to be in the hasTextContent function in /wp-
includes/js/tinymce/plugins/wpeditimage/plugin.js that function checks if
the link has any text contents however since the introduction of the
inline boundaries for links there is a character in there to place the
caret the zwnbsp char or \ufeff so the function needs to trim those. So
the function should be something like:
{{{
function hasTextContent( node ) {
return node && !! ( node.textContent || node.innerText
).replace(/\ufeff/g, '');
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41259#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list