Skip to content

Commit

Permalink
fix: update visitor for linkelements
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeppner-dataport committed Sep 29, 2023
1 parent 0825839 commit 7afd6bb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ export class ContentElementUpdateVisitor implements BoardCompositeVisitor {
}

visitLinkElement(linkElement: LinkElement): void {
if (!(this.content instanceof LinkContentBody)) {
if (this.content instanceof LinkContentBody) {
const urlWithProtocol = this.content.url.match(/:\/\//) ? this.content.url : `https://${this.content.url}`;
linkElement.url = new URL(urlWithProtocol).toString();
} else {
this.throwNotHandled(linkElement);
}
}
Expand Down

0 comments on commit 7afd6bb

Please sign in to comment.