Done
This commit is contained in:
parent
1880995e06
commit
d3de14c2a1
3 changed files with 4 additions and 4 deletions
|
@ -135,7 +135,7 @@ const embedId = `embed${Math.random().toString().replace(/\D/, "")}`;
|
||||||
let tweetHeight = ref(150);
|
let tweetHeight = ref(150);
|
||||||
|
|
||||||
const requestUrl = new URL(props.url);
|
const requestUrl = new URL(props.url);
|
||||||
if (!["http:", "https:", "gopher:", "gemini:", "matrix:"].includes(requestUrl.protocol))
|
if (!["http:", "https:", "gopher:", "gemini:", "matrix:", "ipfs:", "ipns:"].includes(requestUrl.protocol))
|
||||||
throw new Error("invalid url");
|
throw new Error("invalid url");
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -45,7 +45,7 @@ const props = defineProps<{
|
||||||
|
|
||||||
const self = props.url.startsWith(local);
|
const self = props.url.startsWith(local);
|
||||||
const url = new URL(props.url);
|
const url = new URL(props.url);
|
||||||
if (!["http:", "https:", "gopher:", "gemini:", "matrix:"].includes(url.protocol)) throw new Error("invalid url");
|
if (!["http:", "https:", "gopher:", "gemini:", "matrix:", "ipfs:", "ipns:"].includes(url.protocol)) throw new Error("invalid url");
|
||||||
const el = ref();
|
const el = ref();
|
||||||
|
|
||||||
useTooltip(el, (showing) => {
|
useTooltip(el, (showing) => {
|
||||||
|
|
|
@ -674,7 +674,7 @@ export const language = P.createLanguage({
|
||||||
]));
|
]));
|
||||||
const parser = P.seq([
|
const parser = P.seq([
|
||||||
notLinkLabel,
|
notLinkLabel,
|
||||||
P.regexp(/((https?)|(gemini)|(gopher)|(matrix)):\/\//),
|
P.regexp(/((https?)|(gemini)|(gopher)|(matrix)|(ipns)|(ipfs)):\/\//),
|
||||||
innerItem.many(1).text(),
|
innerItem.many(1).text(),
|
||||||
]);
|
]);
|
||||||
return new P.Parser<M.MfmUrl | string>((input, index, state) => {
|
return new P.Parser<M.MfmUrl | string>((input, index, state) => {
|
||||||
|
@ -706,7 +706,7 @@ export const language = P.createLanguage({
|
||||||
const parser = P.seq([
|
const parser = P.seq([
|
||||||
notLinkLabel,
|
notLinkLabel,
|
||||||
open,
|
open,
|
||||||
P.regexp(/((https?)|(gemini)|(gopher)|(matrix)):\/\//),
|
P.regexp(/((https?)|(gemini)|(gopher)|(matrix)|(ipns)|(ipfs)):\/\//),
|
||||||
P.seq([P.notMatch(P.alt([close, space])), P.char], 1).many(1),
|
P.seq([P.notMatch(P.alt([close, space])), P.char], 1).many(1),
|
||||||
close,
|
close,
|
||||||
]).text();
|
]).text();
|
||||||
|
|
Loading…
Reference in a new issue