LInk.web in RichText is not handled correctly

Hi there before I found this place I posted the issue on Github issues. Maybe someone will get back to me here.

In shortcut my problem is that Link.web is not rendered and the easiest snippet to verify it is:

console.log(
    PrismicDom.RichText.asHtml(
        [
            {
                "type": "paragraph",
                "text": "Visit my link in browser",
                "spans": [
                    {
                        "start": 6,
                        "end": 13,
                        "type": "hyperlink",
                        "data": {
                            "type": "Link.web",
                            "value": {
                                "url": "https://www.domain.tld",
                                "target": "_blank"
                            }
                        }
                    }
                ]
            }
        ],
        function (doc) {
            return doc;
        }
    )
);

this results in <p>Visit <a href="">my link</a> in browser</p> - as you can see there is no link, no target, etc...

In the github issue I also suggested what could be potential fix in the PrismicDom library, but I'm not sure if it wouldn't brake other things.

thank you in advance for your help

it was problem that I was still fetching the api v1, with v2 it works

the issue can be closed/locked

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.