diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c1997969..03516014 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -123,6 +123,8 @@ Release notes - Refine the way the PURL fragments are handled in searches. https://github.com/aboutcode-org/dejacode/issues/286 +- Fix an issue with ``urlize_target_blank`` when the URL contains curly braces. + ### Version 5.2.1 - Fix the models documentation navigation. diff --git a/component_catalog/templates/component_catalog/tables/package_list_table.html b/component_catalog/templates/component_catalog/tables/package_list_table.html index 2fc961b9..f29f3dc0 100644 --- a/component_catalog/templates/component_catalog/tables/package_list_table.html +++ b/component_catalog/templates/component_catalog/tables/package_list_table.html @@ -1,6 +1,5 @@ {% load i18n %} {% load inject_preserved_filters from dje_tags %} -{% load urlize_target_blank from dje_tags %} {% load naturaltime_short from dje_tags %} {% if form or add_to_component_form %} diff --git a/dje/templatetags/dje_tags.py b/dje/templatetags/dje_tags.py index 1df93201..007c6238 100644 --- a/dje/templatetags/dje_tags.py +++ b/dje/templatetags/dje_tags.py @@ -21,6 +21,7 @@ from django.utils.html import format_html from django.utils.html import urlize as _urlize from django.utils.http import urlencode +from django.utils.safestring import mark_safe register = Library() @@ -139,7 +140,7 @@ def urlize_target_blank(value, autoescape=True): else: link = _urlize(value, nofollow=True, autoescape=autoescape) link = link.replace("' "ftp://domain.com", ), + ( + "https://repo1.maven.org/maven2/{0/group_id}/{0.version}.jar", + '' + "https://repo1.maven.org/maven2/{0/group_id}/{0.version}.jar", + ), ] for url, expected in inputs: