FIX: allow quote and the diacritrics in the image URL

FIX: allow quote and the diacritrics in the image URL

diff --git a/lib/onebox/helpers.rb b/lib/onebox/helpers.rb
index c626f4b..e1eaa68 100644
--- a/lib/onebox/helpers.rb
+++ b/lib/onebox/helpers.rb
@@ -169,7 +169,7 @@ module Onebox
       url.gsub!(' ', '%20')
       url.gsub!("'", "'")
       url.gsub!('"', """)
-      url.gsub!(/[^\w\-`.~:\/?#\[\]@!$&'\(\)*+,;=%]/, "")
+      url.gsub!(/[^\w\-`.~:\/?#\[\]@!$&'\(\)*+,;=%\p{M}’]/, "")
       url
     end

GitHub sha: 57d43ad7

This commit has been mentioned on Discourse Meta. There might be relevant details there:

Got add a test case here, the regex is … complicated… so it would be nice to see a specification for normalize_url_for_output it should be a super cheap test case to add.

2 Likes

Added specs in:

2 Likes