Skip to content

Commit

Permalink
IBX-8340: RichText: Not possible to create a link to a custom route (#…
Browse files Browse the repository at this point in the history
…165)

Co-authored-by: Jakub Brzegowski <symfiz@gmail.com>
  • Loading branch information
vidarl and tischsoic authored Jul 1, 2024
1 parent b1206d4 commit b148e3d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ class IbexaLinkFormView extends View {
}

const anchorPrefix = '#';
const relativeLinkPrefix = '/';
const schemaPattern = /^[a-z0-9]+:\/?\/?/i;
const isAnchor = href.indexOf(anchorPrefix) === 0;
const isRelativeLink = href.startsWith(relativeLinkPrefix);
const isLocation = schemaPattern.test(href);

if (isAnchor || isLocation) {
if (isAnchor || isLocation || isRelativeLink) {
return href;
}

Expand Down

0 comments on commit b148e3d

Please sign in to comment.