Skip to content

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

@bjarnef

Description

@bjarnef

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.


This item has been added to our backlog AB#56364

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions