From 80621f598e53035983e5af6b0dca956475b8ff90 Mon Sep 17 00:00:00 2001 From: triphora Date: Fri, 24 Mar 2023 15:03:50 -0400 Subject: [PATCH] Small fixes (#1061) --- helpers/infer.js | 9 +++++++++ helpers/parse.js | 7 +++++++ pages/[type]/[id]/settings/links.vue | 22 +++++++++++----------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/helpers/infer.js b/helpers/infer.js index 6ad1dbd2..7a1792f9 100644 --- a/helpers/infer.js +++ b/helpers/infer.js @@ -238,6 +238,12 @@ export const inferVersionInfo = async function (rawFile, project, gameVersions) case 10: newGameVersions = getRange('1.19', '1.19.3') break + case 11: + newGameVersions = getRange('23w03a', '23w05a') + break + case 12: + newGameVersions.push('1.19.4') + break default: } } @@ -279,6 +285,9 @@ export const inferVersionInfo = async function (rawFile, project, gameVersions) case 12: newGameVersions.push('1.19.3') break + case 13: + newGameVersions.push('1.19.4') + break default: } } diff --git a/helpers/parse.js b/helpers/parse.js index a1c31c52..dbfe6b5c 100644 --- a/helpers/parse.js +++ b/helpers/parse.js @@ -31,6 +31,10 @@ export const configuredXss = new xss.FilterXSS({ /^https?:\/\/(www\.)?youtube(-nocookie)?\.com\/embed\/[a-zA-Z0-9_-]{11}(\?&autoplay=[0-1]{1})?$/, remove: ['&autoplay=1'], // Prevents autoplay }, + { + regex: /^https?:\/\/(www\.)?discord\.com\/widget\?id=\d{18,19}(&theme=\w+)?$/, + remove: [/&theme=\w+/], + }, ] for (const source of allowedSources) { @@ -107,13 +111,16 @@ export const md = (options = {}) => { const url = new URL(src) const allowedHostnames = [ + 'imgur.com', 'i.imgur.com', 'cdn-raw.modrinth.com', 'cdn.modrinth.com', 'staging-cdn-raw.modrinth.com', 'staging-cdn.modrinth.com', + 'github.com', 'raw.githubusercontent.com', 'img.shields.io', + 'i.postimg.cc', ] if (allowedHostnames.includes(url.hostname)) { diff --git a/pages/[type]/[id]/settings/links.vue b/pages/[type]/[id]/settings/links.vue index 6ffe2e22..851fdef2 100644 --- a/pages/[type]/[id]/settings/links.vue +++ b/pages/[type]/[id]/settings/links.vue @@ -85,6 +85,14 @@ :key="`donation-link-${index}`" class="input-group donation-link-group" > + -