Jira issue details - Breadcrumb title has broken UI around icon, text
With a change in f914aa74, we seem to have introduced a nested link (a link within a link) which is not valid HTML, causing 2 issues: the text breaks to a new line and the link includes an empty URL.
Example URL http://127.0.0.1:3000/gitlab-org/gitlab-test/-/integrations/jira/issues/FE-4
.
An example solution can be found below:
diff --git a/ee/app/helpers/ee/integrations_helper.rb b/ee/app/helpers/ee/integrations_helper.rb
index c6c6fb44bb5c..5962cda499dc 100644
--- a/ee/app/helpers/ee/integrations_helper.rb
+++ b/ee/app/helpers/ee/integrations_helper.rb
@@ -77,18 +77,7 @@ def zentao_issues_show_data
# Returns a sanitized `ActiveSupport::SafeBuffer` link.
def external_issue_breadcrumb_link(img, text, href, options = {})
icon = image_tag image_path(img), width: 15, height: 15, class: 'gl-mr-2'
- link = sanitize(
- link_to(
- strip_tags(text),
- strip_tags(href),
- options.merge(
- rel: 'noopener noreferrer',
- class: 'gl-display-flex gl-align-items-center gl-white-space-nowrap'
- )
- ),
- tags: %w[a img],
- attributes: %w[target href src loading rel class width height]
- )
+ link = strip_tags(text)
[icon, link].join.html_safe
end