ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.49k stars 3.7k forks source link

Bookmarks: part 2 #17180

Closed Witoso closed 2 days ago

Witoso commented 3 weeks ago

Provide a description of the task

Goal

Implement more advanced handling of bookmarks (e.g. pasting) and data loading.

Description

After implementing #17063, we continue in Bookmarks implementation. Focus is on finishing the main work in bookmarks: pasting, handling loading of different data.

Scope

// CASE 1 - name the same as ID
// Input data
<p>
    <a id="xyz" name="xyz">This text is in the bookmark</a>
</p>

// After (default): consume the name but don't add to <a>;
// name is consumed only if identical with id. 
<p>
    <a id="xyz"></a>
    This text is in the bookmark
</p>

// Opt-out by config (handled by other converters, GHS),
// we don't show bookmark UI
<p>
    <a id="xyz">This text is in the bookmark</a>
</p>

// CASE 2 - just name
// Input data
<p>
    <a name="xyz">This text is in the bookmark</a>
</p>

// After (default): change name to id
<p>
    <a id="xyz"></a>
    This text is in the bookmark
</p>

// Opt-out by config (handled by other converters, GHS),
// we don't show bookmark UI
<p>
    <a id="xyz">This text is in the bookmark</a>
</p>

// CASE 3 - no content, but name
// Input data
<p>
    <a name="xyz"></a>
    This text is in the bookmark
</p>

// After: change name to id
<p>
    <a id="xyz"></a>
    This text is in the bookmark
</p>

// CASE 4 - name and id are different
// Input data
<p>
    <a id="xyz" name="abc">This text is in the bookmark</a>
</p>

// After (default): name not consumed (handled by GHS if enabled)
<p>
    <a id="xyz" name="abc"></a>
    This text is in the bookmark
</p>
Witoso commented 2 days ago

This part is also done, not merged to master yet.