@hlfan commented on this pull request.


> @@ -88,25 +88,19 @@ def sanitize(text)
     end
 
     def linkify(text, mode = :urls)
-      ERB::Util.html_escape(text)
-               .then { |html| expand_link_shorthands(html) }
-               .then { |html| expand_host_shorthands(html) }
-               .then { |html| auto_link(html, mode) }
-               .html_safe
+      link_attr = 'rel="nofollow noopener noreferrer" dir="auto"'
+      ERB::Util
+        .html_escape(text)
+        .then { |html| expand_link_shorthands(html) }
+        .then { |html| expand_host_shorthands(html) }
+        .then { |html| Rinku.auto_link(html, mode, link_attr) { |url| 
shorten_link(shorten_hosts(url)) } }

You already mentioned re-enabling it for markdown later on.
In that case, rather than overwriting the gsub pair generator, I'd like to add 
flags to this linkify function to toggle the pairs of expanding & shortening. 
Then having both in the same function makes things easier.

Also, I didn't like having these pairs split in different places.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6674#discussion_r2674216024
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6674/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to