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
Functional requirements:
Handling wrapped bookmarks/anchors. <a name="" id="xyz">This text is in the bookmark</a>. We have multiple cases but in general, by default wrapped anchor will transition to pointed anchor, but there will be an opt-out config.
// 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>
Opt-out config from above examples:
Opt-out should be configured in config and work only for setData.
Opt-out means, that anchor with content will be preserved to be handled by other features, but not parsed as a bookmark.
Input from clipboard (pasting) with anchors from Word/GDoc/Excel sources transforms correctly to Bookmarks.
Whatever is in clipboard, should be converted to correct bookmark
It is not configurable (opt-out from above has no effect)
Paste from Word/GDoc/Excel) should behave as setData.
Trim bookmarkId in insert/update command.
Copy/Paste within the same editor
During copy-paste we leave the ID unchanged. This will lead to potential duplicates of IDs. But detecting duplicates may be tricky, and pasting would need to check agaist all elements that may have an ID. We decided to not handle this right now.
Change input label name from Add bookmark name into Bookmark name
Change form button text, depending on action Insert/Update
Non-functional requirements:
Bookmarks work with collaboration features (especially track changes).
Pagination (make sure we are not including bookmarks).
Make sure that attributes added by GHS to a bookmark do not turn it to link.
Figure out how bookmarks could be handled in exports and import (Word/PDF).
There’s shouldn’t any problems, we just need to test it.
Discuss content accessibility with bookmarks.
All good: widgets ✅, output content: no need to provide anything (invisible element).
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
<a name="" id="xyz">This text is in the bookmark</a>
. We have multiple cases but in general, by default wrapped anchor will transition to pointed anchor, but there will be an opt-out config.setData
.setData
.bookmarkId
in insert/update command.Add bookmark name
intoBookmark name
Insert
/Update