There are 5 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-717377d3-4a47-4baf-b87e-f45007e1e9d7 XWIKI-25734 Closed

The display text typed in the BlockNote link modal is ignored when creating a link from a text selection

 
View issue   ยท   Add comment
 

5 updates

 
cid:jira-generated-image-avatar-c22a7b00-6a72-45ce-b0b9-6fbf8dff4a51 Changes by Marius Dumitru Florea on 12/Nov/26 10:25
 
Documentation in Release Notes: N/A
Documentation: N/A
Resolution: Fixed
Tests: Integration
Status: Open Closed
 
 

1 comment

 
cid:jira-generated-image-avatar-c22a7b00-6a72-45ce-b0b9-6fbf8dff4a51 Marius Dumitru Florea on 12/Nov/26 10:26
 
Fixed in [5cfb70ee2aa|https://github.com/xwiki/xwiki-platform/commit/5cfb70ee2aa] (not pushed yet) . The link created from a text selection with the formatting toolbar now uses the display text of the link modal:
* *Display text left unchanged* (it's pre-filled with the selected text): the selection is linked in place, so it keeps its inline formatting, e.g. a bold part of the selected text.
*
{ * } Display text changed { * } : the selection is replaced with the new display text, which keeps the formatting shared by the whole selection (e.g. a bold word stays bold), like typing over the selection does. Note that whatever the selection held besides text (e.g. an inline macro) is replaced too.
*
{ * } Display text emptied { * } : the link label is generated from the link target (e.g. the page title), and it replaces the selection unless it's the same as the selected text.

The selected text is now read when the link modal is opened, so it's compared with the display text the user submits.

The links inserted with the {{/link}} quick action already used the display text, and so did the edited links: when the display text of an edited link is left unchanged, its text keeps its inline formatting, which is now tested as well.