merge: Improve inline quote detection and link previews (resolves #1047 and #1044) (!985)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/985

Closes #1047 and #1044

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Marie 2025-05-08 16:09:15 +00:00
commit aa9d834a39
2 changed files with 160 additions and 42 deletions

View file

@ -176,4 +176,14 @@ export class UtilityService {
const host = this.extractDbHost(uri);
return this.isFederationAllowedHost(host);
}
@bindThis
public getUrlScheme(url: string): string {
try {
// Returns in the format "https:" or an empty string
return new URL(url).protocol;
} catch {
return '';
}
}
}