This issue has been created
There are 2 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e1fe650c-4baf-4969-a951-be32841fede2 XWIKI-25734 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-549059e5-d872-468d-b254-bdc7d873a073 Marius Dumitru Florea created this issue on 12/Nov/26 10:20
 
Summary: The display text typed in the BlockNote link modal is ignored when creating a link from a text selection
Issue Type: cid:jira-generated-image-avatar-e1fe650c-4baf-4969-a951-be32841fede2 Bug
Affects Versions: 18.7.0
Assignee: Unassigned
Components: BlockNote
Created: 12/Nov/26 10:20
Priority: cid:jira-generated-image-static-major-462de099-039b-416b-9614-89fe1825cfc5 Major
Reporter: Marius Dumitru Florea
Description:

Steps to reproduce

  1. Edit a page with the BlockNote editor.
  2. Select a word in a paragraph, e.g. "second" in "first second third".
  3. Click the link button of the formatting toolbar: the link modal is pre-filled with the selected text as display text.
  4. Set a link target (e.g. the URL https://xwiki.org), expand the "Options" section and change the display text, e.g. to "2nd".
  5. Submit the link modal.

Actual result

The selected word is linked, but the link label is still "second": the display text typed in the link modal is ignored.

Expected result

The link label is "2nd", the display text typed in the link modal.

Notes

  • Only the links created from a text selection, using the formatting toolbar, are affected. The links inserted with the /link quick action and the edited links use the display text.
  • When the display text is left unchanged, the selected text should be linked in place, keeping its inline formatting (e.g. a bold part).
 
 

2 updates

 
cid:jira-generated-image-avatar-549059e5-d872-468d-b254-bdc7d873a073 Changes by Marius Dumitru Florea on 12/Nov/26 10:20
 
Fix Version: 18.10.0-rc-1
Assignee: Marius Dumitru Florea
 
 

1 comment

 
cid:jira-generated-image-avatar-549059e5-d872-468d-b254-bdc7d873a073 Marius Dumitru Florea on 12/Nov/26 10:21
 

Fixed in 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.