There are 2 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-5fa581a7-f59d-4e35-a4f7-72f016ee5d36 XWIKI-25803 Closed

Pre-fill the link target with the selected text or the typed query in the BlockNote link modal

 
View issue   ยท   Add comment
 

2 updates

 
cid:jira-generated-image-avatar-ff96f821-8024-43c4-85ba-2f4f6746ea86 Changes by Marius Dumitru Florea on 19/Nov/26 14:06
 
Resolution: Fixed
Status: Open Closed
 
 

1 comment

 
cid:jira-generated-image-avatar-ff96f821-8024-43c4-85ba-2f4f6746ea86 Marius Dumitru Florea on 19/Nov/26 14:06
 

Implemented in the BlockNote editor (no change to the link modal itself):

  • Creating a link from a selection: the link target is pre-filled, in addition to the display text, with the page named after the selected text, relative to the edited page. The page search box being focused when the link modal opens, the pages matching the selected text are suggested right away, and the link can be submitted as is to link to a page named after the text, whether it exists or not.
  • Choosing Link to... in the link suggestion menu (slash menu Link item or [[ trigger): the link target is pre-filled the same way with the typed query. The display text is left empty, so that the link label is generated from the target.
  • When the text is a URL (e.g. https://xwiki.org or john@example.orgmail_small.gif), the target is that URL instead.
  • Nothing is pre-filled when the text is empty or spans several lines (e.g. a selection of several blocks).

To link to the current page (or one of its sections) from a selection, the user now has to empty the pre-filled page reference.

Tests: unit and component tests for both entry points, an end-to-end component test through the link modal, and the LinkIT functional tests updated accordingly.