-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15373 from ckeditor/ck/15051
Fix (html-support): The `DocumentSelection` should not store the GHS `linkA` attribute if the `linkHref` attribute was removed by the two-step caret movement feature. Closes #15051. Other (link, typing): The logic behind the two-step caret movement extracted to the common code in the two-step caret movement feature. Other (typing): Unified behavior of the `insertText` command for cases using the `DocumentSelection` and `Selection` as applied attributes behaved differently in those cases.
- Loading branch information
Showing
12 changed files
with
1,456 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/ckeditor5-html-support/tests/manual/ghs-link.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<head> | ||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' https://ckeditor.com 'unsafe-inline' 'unsafe-eval'"> | ||
<style> | ||
.link { | ||
display: inline-block; | ||
padding: 1em; | ||
outline: 1px solid rgba(255, 0, 0, 0.3); | ||
} | ||
</style> | ||
</head> | ||
|
||
<div id="editor"> | ||
<p>foo <a href="#bar" class="link">bar</a></p> | ||
<p>foo <a href="#bar" class="link">bar</a> baz</p> | ||
<p><a href="#bar" class="link">bar</a> baz</p> | ||
<p><a href="#bar" class="link">bar</a></p> | ||
<p><a href="#foo" class="link">foo</a><a href="#bar" class="link">bar</a></p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals console:false, window, document */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; | ||
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; | ||
import SourceEditing from '@ckeditor/ckeditor5-source-editing/src/sourceediting'; | ||
|
||
import GeneralHtmlSupport from '../../src/generalhtmlsupport'; | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#editor' ), { | ||
plugins: [ | ||
ArticlePluginSet, SourceEditing, GeneralHtmlSupport | ||
], | ||
toolbar: [ | ||
'sourceEditing', | ||
'|', | ||
'heading', | ||
'|', | ||
'bold', 'italic', 'link', | ||
'|', | ||
'undo', 'redo' | ||
], | ||
htmlSupport: { | ||
allow: [ | ||
{ | ||
name: /^.*$/, | ||
styles: true, | ||
attributes: true, | ||
classes: true | ||
} | ||
] | ||
} | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
## GHS Link handling |
Oops, something went wrong.