diff --git a/customize.dist/ckeditor-contents.css b/customize.dist/ckeditor-contents.css index 75d054230..0fdb35d56 100644 --- a/customize.dist/ckeditor-contents.css +++ b/customize.dist/ckeditor-contents.css @@ -158,14 +158,18 @@ a > img { border: 2px solid red; border-right-color: transparent !important; border-left-color: transparent !important; + margin-left: -2px; + margin-right: -2px; } .cp-cursor-position[data-type="start"] { border-left: none; border-right-width: 4px; + margin-right: -4px; } .cp-cursor-position[data-type="end"] { border-right: none; border-left-width: 4px; + margin-left: -4px; } .cp-cursor-avatar { display: flex; diff --git a/www/common/cursor.js b/www/common/cursor.js index 01f71d8d5..ceabfd133 100644 --- a/www/common/cursor.js +++ b/www/common/cursor.js @@ -73,6 +73,10 @@ define([ el: range[t + 'Container'], offset: range[t + 'Offset'] }; + while (inNode.el.nodeType !== Node.TEXT_NODE && inNode.el.childNodes.length > inNode.offset) { + inNode.el = inNode.el.childNodes[inNode.offset]; + inNode.offset = 0; + } var current = inNode.el; var path = []; while (current !== element) {