wopi: Action_InsertLink: accept optional "text" label from the host#15561
Merged
pedropintosilva merged 1 commit intoApr 22, 2026
Merged
Conversation
Until now Action_InsertLink only took a "url" argument, and the inserted hyperlink was labelled with either the user's current selection or the URL itself when no selection existed. The problem is that the integrators often pass opaque or at least very lengthly URLs (file IDs, full path + etc), the result: ugly links in the document where they could have been set nicely with a title (using the document name). Better to, accept an additional optional "text" value so the host can supply a human-friendly label (typically the filename from its link picker). The selected text case still works as before: Existing selection still wins over the optional new text, because the user explicitly marked the text they want to turn into a link; only when there is no selection does the host-supplied "text" take over. If neither is available the URL is still used: -> Label precedence: selection > host-supplied text > URL. The change is backward-compatible: hosts that do not send "text" behave exactly as before. Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com> Change-Id: I70a5c0c1a453cc51ff704b30cc47f05eb20bfa72
Contributor
Author
|
@eszkadev , the tests have passed |
This was referenced Apr 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now Action_InsertLink only took a "url" argument, and the inserted
hyperlink was labelled with either the user's current selection or the
URL itself when no selection existed. The problem is that the
integrators often pass opaque or at least very lengthly URLs (file
IDs, full path + etc), the result: ugly links in the document where
they could have been set nicely with a title (using the document
name).
Better to, accept an additional optional "text" value so the host can
supply a human-friendly label (typically the filename from its link picker).
The selected text case still works as before:
Existing selection still wins over the optional new text, because the
user explicitly marked the text they want to turn into a link; only
when there is no selection does the host-supplied "text" take over. If
neither is available the URL is still used:
-> Label precedence: selection > host-supplied text > URL.
The change is backward-compatible: hosts that do not send "text" behave
exactly as before.
Signed-off-by: Pedro Pinto Silva pedro.silva@collabora.com
Change-Id: I70a5c0c1a453cc51ff704b30cc47f05eb20bfa72
So, instead getting the following in our document:
https://staging-perf.eu.collaboraonline.com/nextcloud/index.php/f/305801
we would get:
Track-Changes-Example.docx