mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Update Font system
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user