Remove copy of MediaRepository mxcUrl parsing.

This commit is contained in:
Danila Fedorin 2021-07-09 13:09:19 -07:00
parent 1435c2c9a2
commit abd62373e5

View file

@ -73,16 +73,6 @@ function parseCodeBlock(options, node) {
return new CodeBlock(language, codeNode.textContent);
}
// TODO: duplicated from MediaRepository. Extract somewhere.
function parseMxcUrl(url) {
const prefix = "mxc://";
if (url.startsWith(prefix)) {
return url.substr(prefix.length).split("/", 2);
} else {
return null;
}
}
function parseImage(options, node) {
const { result, mediaRepository } = options;
const src = result.getAttributeValue(node, "src") || "";