Parse matrix URI links
This commit is contained in:
parent
620cf9d93f
commit
eef5cbbace
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
import { linkify } from "./linkify/linkify.js";
|
||||
import { getIdentifierColorNumber, avatarInitials } from "../../../avatar.js";
|
||||
import { MatrixURL } from "matrix-uri-parser";
|
||||
|
||||
/**
|
||||
* Parse text into parts such as newline, links and text.
|
||||
|
@ -124,6 +125,11 @@ export class LinkPart {
|
|||
constructor(url, inlines) {
|
||||
this.url = url;
|
||||
this.inlines = inlines;
|
||||
if (url.startsWith("matrix:")) {
|
||||
this.matrixUrl = new MatrixURL(url);
|
||||
} else {
|
||||
this.matrixUrl = null;
|
||||
}
|
||||
}
|
||||
|
||||
get type() { return "link"; }
|
||||
|
|
Reference in a new issue