From: Tom Hughes Date: Tue, 3 Jan 2023 19:20:31 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/3868' X-Git-Tag: live~1448 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fb81107b6e953bf8b55a766dc72266dd7d762269?hp=c3cc8eb687e92c890a7c4801c262fb2e6c96ef0a Merge remote-tracking branch 'upstream/pull/3868' --- diff --git a/app/helpers/browse_tags_helper.rb b/app/helpers/browse_tags_helper.rb index 0784d03ca..c6aeb8c54 100644 --- a/app/helpers/browse_tags_helper.rb +++ b/app/helpers/browse_tags_helper.rb @@ -32,7 +32,7 @@ module BrowseTagsHelper elsif colour_value = colour_preview(key, value) tag.span("", :class => "colour-preview-box", :"data-colour" => colour_value, :title => t("browse.tag_details.colour_preview", :colour_value => colour_value)) + colour_value else - linkify h(value) + safe_join(h(value).split(";").map { |x| linkify(x) }, ";") end end diff --git a/test/helpers/browse_tags_helper_test.rb b/test/helpers/browse_tags_helper_test.rb index 3f36b9210..2329a7c96 100644 --- a/test/helpers/browse_tags_helper_test.rb +++ b/test/helpers/browse_tags_helper_test.rb @@ -49,6 +49,12 @@ class BrowseTagsHelperTest < ActionView::TestCase html = format_value("contact", "foo@example.com") assert_dom_equal "foo@example.com", html + + html = format_value("source", "https://example.com") + assert_dom_equal "https://example.com", html + + html = format_value("source", "https://example.com;hello;https://example.net") + assert_dom_equal "https://example.com;hello;https://example.net", html end def test_wiki_link