There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-9330dd93-7555-4b56-8321-d985f40d89c3 XWIKI-25726 Open

The BlockNote link modal creates links with absolute references

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-66b1a618-00c8-4903-831c-3402a820fcf9 Marius Dumitru Florea on 11/Nov/26 18:43
 

Summary of the changes:

  • The link modal now knows which document the edited link is in. The new LinkContext type (link-type-api) carries that document. It's passed to LinkTargetType#fromReference / #toReference, to the LinkTargetTypeManager and to the target fields of the link modal. The XWiki BlockNote integration sets it to the edited document.
  • The model reference parser can now resolve a reference against a base reference (ModelReferenceParserOptions#base). The serializer can serialize a reference relative to one (ModelReferenceSerializer#serialize(reference, base)).
  • Page and attachment links are displayed, parsed and saved relative to the edited document. For example, a link to a page in the same space is saved as Page, not xwiki:Space.Page. When you edit a link, the editor matches it to its reference whether that reference is written in full or relative to the document.
  • The XWiki model reference serializer and parser now use the same format as the default server-side entity reference serializer and resolver, e.g. wiki:Space.Page@file.png. Previously the serializer put the resource type (doc:, attach:, space:) in front of the entity reference, and the parser went through the resource reference parser. Now the entity type is passed to the parser when the reference isn't a page reference.
    • As a result, the code that stripped this prefix is gone: in the link target types, the link target fields and the realtime collaboration room name.
    • This also fixes the page hierarchy REST URL, which was built from doc:wiki:Space.Page.
  • The image selector now parses a typed reference as an attachment reference. Before, it parsed it as a page reference.
  • An uploaded image is inserted with an untyped attachment reference, the same as the image suggestions.
  • Removed the unused LinkEditionContext from blocknote-react.