Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links in richtext doesn't include hash returned from Delivery API #18475

Open
bjarnef opened this issue Feb 26, 2025 · 2 comments
Open

Links in richtext doesn't include hash returned from Delivery API #18475

bjarnef opened this issue Feb 26, 2025 · 2 comments

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Feb 26, 2025

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.6.0

Bug summary

We noticed when inserting a link with hash, it isn't include in HTML markup property returned from Delivery API - only as data attribute.

Image

Image

Raw HTML in TinyMCE is:

<p><a href="/{localLink:umb://document/6f2c758af14649be95e22de64cf7a3c9}#mcb-test-123" title="Om Uddannelsesnævnet (1)" data-anchor="#mcb-test-123">Link</a></p>

If it was a tradtional MVC project with Razor we could just render HTML and it works, but when we render this in headless frontend, it just render:

<p><a href="/om-uddannelsesnaevnet-1/" title="Om Uddannelsesnævnet (1)" data-anchor="#mcb-test-123" data-start-item-path="forside" data-start-item-id="16d35c1c-622d-458a-bf61-efff24aea339">Link</a></p>

Specifics

No response

Steps to reproduce

Insert a link via link picker in TinyMCE and set a value for anchor.

Notice hash is part of anchor href.

Furthermore in a nested block I have this:

Image

but Delivery API returns:

{ "url": null, "queryString": null, "title": "Efteruddannelse", "target": null, "destinationId": "118ef471-a2a7-4728-b7d2-1397e127b9b9", "destinationType": "standardPage", "route": { "path": "/efteruddannelse/", "startItem": { "id": "16d35c1c-622d-458a-bf61-efff24aea339", "path": "forside" } }, "linkType": "Content" }

Image

It seems queryString wasn't part or url, so we previously added this:

if (queryString) {
    url += queryString
}

However I checked with querystring as well and get this:

Image

Image

But since fragment seems to be added to URL, we get double hash in URL: #haklmedlemmer#haklmedlemmer

It seems it may have introduced this change recently as url property previously didn't include querystring, but it seems it does now.

Expected result / actual result

A value /om-uddannelsesnaevnet-1/#mcb-test-123 in href attribute.

Copy link

Hi there @bjarnef!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@bjarnef
Copy link
Contributor Author

bjarnef commented Feb 26, 2025

@kjac could this be affected by change in #15327 regarding querystring (including fragment/hash) now seems to be included in url property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants