From: Tom Hughes Date: Fri, 15 Dec 2023 17:29:31 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/4406' X-Git-Tag: live~901 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d3bd761a0f5bbd5dc8aab548a958d44b4379cf2c?hp=9d717d45417f1cdb971da6f3dd2e9f2ba66ddcfd Merge remote-tracking branch 'upstream/pull/4406' --- diff --git a/app/helpers/browse_tags_helper.rb b/app/helpers/browse_tags_helper.rb index 014b8262d..1bda7dcb7 100644 --- a/app/helpers/browse_tags_helper.rb +++ b/app/helpers/browse_tags_helper.rb @@ -36,7 +36,7 @@ module BrowseTagsHelper elsif colour_value = colour_preview(key, value) tag.span("", :class => "colour-preview-box float-end m-1 border border-dark border-opacity-10", :"data-colour" => colour_value, :title => t("browse.tag_details.colour_preview", :colour_value => colour_value)) + colour_value else - safe_join(value.split(";").map { |x| linkify(h(x)) }, ";") + safe_join(value.split(";", -1).map { |x| linkify(h(x)) }, ";") end end diff --git a/test/helpers/browse_tags_helper_test.rb b/test/helpers/browse_tags_helper_test.rb index 0af0d9310..0786af61d 100644 --- a/test/helpers/browse_tags_helper_test.rb +++ b/test/helpers/browse_tags_helper_test.rb @@ -22,6 +22,12 @@ class BrowseTagsHelperTest < ActionView::TestCase html = format_value("unknown", "unknown") assert_dom_equal "unknown", html + html = format_value("unknown", "abc;def") + assert_dom_equal "abc;def", html + + html = format_value("unknown", "foo;") + assert_dom_equal "foo;", html + html = format_value("addr:street", "Rue de l'Amigo") assert_dom_equal "Rue de l'Amigo", html