Skip to content

Commit

Permalink
Merge pull request #8978 from ckeditor/i/8852
Browse files Browse the repository at this point in the history
Fix (engine): Words should not break on link boundaries. Closes #8852.
  • Loading branch information
Reinmar committed Feb 18, 2021
2 parents 86fa4af + f5e3e7a commit b67732d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions packages/ckeditor5-engine/src/view/filler.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,11 @@ export const BR_FILLER = domDocument => {
export const INLINE_FILLER_LENGTH = 7;

/**
* Inline filler which is a sequence of the zero width spaces.
* Inline filler which is a sequence of the word joiners.
*
* @type {String}
*/
export const INLINE_FILLER = ( () => {
let inlineFiller = '';

for ( let i = 0; i < INLINE_FILLER_LENGTH; i++ ) {
inlineFiller += '\u200b';
}

return inlineFiller;
} )(); // Usu IIF so the INLINE_FILLER appears as a constant in the docs.
export const INLINE_FILLER = '\u2060'.repeat( INLINE_FILLER_LENGTH );

/**
* Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-engine/tests/manual/tickets/462/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ClassicEditor
const domSelection = document.getSelection();
const selectionExists = domSelection && domSelection.anchorNode;

console.log( editor.editing.view.getDomRoot().innerHTML.replace( /\u200b/g, '@' ) );
console.log( editor.editing.view.getDomRoot().innerHTML.replace( /\u2060/g, '@' ) );
console.log( 'selection.hasAttribute( italic ):', editor.model.document.selection.hasAttribute( 'italic' ) );
console.log( 'selection.hasAttribute( bold ):', editor.model.document.selection.hasAttribute( 'bold' ) );
console.log( 'selection anchor\'s parentNode:', selectionExists ? domSelection.anchorNode.parentNode : 'no DOM selection' );
Expand Down

0 comments on commit b67732d

Please sign in to comment.