From dcec126a9389d594f1516f39add643bfd5dd4509 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 28 Oct 2023 22:45:24 +0300 Subject: [PATCH] fix this https://rdrama.net/h/changelog/post/165657/changelog-megathread-marseynotes/5263219#context --- files/assets/js/markdown.js | 2 +- files/helpers/regex.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/assets/js/markdown.js b/files/assets/js/markdown.js index 7bd625f1aa..6e4039979d 100644 --- a/files/assets/js/markdown.js +++ b/files/assets/js/markdown.js @@ -54,7 +54,7 @@ marked.use({ const reDisableBeforeUnload = /^\/submit|^\/h\/[a-zA-Z0-9_\-]{3,20}\/submit/; const image_regex_extensions = document.getElementById('IMAGE_FORMATS').value.replaceAll(',', '|') -const regex_pattern = String.raw`(^|\s)(https:\/\/[\w\-.#&/=\?@%;+,:]{5,250}(\.|\?format=)(` + image_regex_extensions + String.raw`)((\?|&)[\w\-.#&/=\?@%;+,:]*)?)($|\s)` +const regex_pattern = String.raw`(^|\s)(https:\/\/[\w\-.#&/=\?@%;+,:]{5,250}(\.|\?format=)(` + image_regex_extensions + String.raw`)((\?|&)[\w\-.#&/=\?@%;+,:]*)?)(?=$|\s|<)` const compiled_regex = new RegExp(regex_pattern, "g"); const approved_embed_hosts = document.getElementById('approved_embed_hosts').value.replace("{'", "").replace("'}", "").split("', '") diff --git a/files/helpers/regex.py b/files/helpers/regex.py index e1f1e42290..86917d2a88 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -105,7 +105,7 @@ audio_regex_extensions = '|'.join(AUDIO_FORMATS) audio_sub_regex = re.compile(f'(?