From 4a72f7e9d89124c32b39194a5409bb8dc733486c Mon Sep 17 00:00:00 2001 From: DrumsnChocolate Date: Thu, 21 Nov 2024 21:29:37 +0100 Subject: [PATCH] write a regex for html images. might not be perfect --- app/helpers/markdown_helper.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb index bd20938b..44309a25 100644 --- a/app/helpers/markdown_helper.rb +++ b/app/helpers/markdown_helper.rb @@ -7,10 +7,26 @@ def camofy(markdown) markdown.gsub(markdown_img_regex) do "![#{Regexp.last_match(1)}](#{camo(Regexp.last_match(2))}#{Regexp.last_match(3)})" end + + markdown.gsub(html_img_regex) do + quote_mark = Regexp.last_match(2) + "]*) src=(["']?)(.+?)\2([ >])/ + end end