Update Font system

This commit is contained in:
Dragon Fire
2024-05-01 23:14:31 -04:00
parent 3610ee6f70
commit ae59abaf71
8 changed files with 39 additions and 28 deletions
+2
View File
@@ -211,6 +211,7 @@ module.exports = class Util {
}
static async isUrlNSFW(uri, siteList) {
if (!parseDomain || !ParseResultType) throw new Error('parse-domain still loading');
const parsed = new URL(uri);
const { type, domain, topLevelDomains } = parseDomain(parsed.hostname);
if (type !== ParseResultType.Listed) return null;
@@ -230,6 +231,7 @@ module.exports = class Util {
}
static stripNSFWURLs(str, siteList, text = '[redacted nsfw url]') {
if (!parseDomain || !ParseResultType) throw new Error('parse-domain still loading');
if (!str) return '';
const uris = str.match(/(https?:\/\/\S+)/g);
if (!uris) return str;