From 2b8c8fc92ab4b5fd150ba8c044b7b969f765080f Mon Sep 17 00:00:00 2001
From: Hanabishi <1722-hanabishi@users.noreply.gitlab.archlinux.org>
Date: Wed, 18 Oct 2023 16:19:58 +0000
Subject: [PATCH] fix: make dependency source use superscript tag

Avoid using special characters and use '<sup>' HTML tag instead.
To not rely on user's fonts Unicode coverage.

Closes: #490
Signed-off-by: Hanabishi <1722-hanabishi@users.noreply.gitlab.archlinux.org>
---
 aurweb/packages/util.py                           | 2 +-
 templates/partials/packages/package_metadata.html | 2 +-
 test/test_packages_util.py                        | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/aurweb/packages/util.py b/aurweb/packages/util.py
index cfd1e9e9b..a2c6cbaa2 100644
--- a/aurweb/packages/util.py
+++ b/aurweb/packages/util.py
@@ -85,7 +85,7 @@ def package_link(package: Union[Package, OfficialProvider]) -> str:
 def provides_markup(provides: Providers) -> str:
     links = []
     for pkg in provides:
-        aur = "ᴬᵁᴿ" if not pkg.is_official else ""
+        aur = "<sup><small>AUR</small></sup>" if not pkg.is_official else ""
         links.append(f'<a href="{package_link(pkg)}">{pkg.Name}</a>{aur}')
     return ", ".join(links)
 
diff --git a/templates/partials/packages/package_metadata.html b/templates/partials/packages/package_metadata.html
index c8d583a1d..c5af3ce96 100644
--- a/templates/partials/packages/package_metadata.html
+++ b/templates/partials/packages/package_metadata.html
@@ -21,7 +21,7 @@
                 {% else -%}
                     </a>
                     {%- if dep.is_aur_package() -%}
-                        ᴬᵁᴿ
+                        <sup><small>AUR</small></sup>
                     {% endif %}
                 {% endif %}
 
diff --git a/test/test_packages_util.py b/test/test_packages_util.py
index b429181b5..649e7a99e 100644
--- a/test/test_packages_util.py
+++ b/test/test_packages_util.py
@@ -176,9 +176,9 @@ def test_provides_markup(package: Package):
             RelTypeID=PROVIDES_ID,
         )
 
-    # AUR provider links should end with ᴬᵁᴿ
+    # AUR provider links should end with <sup><small>AUR</small></sup>
     link = util.provides_markup(dep.provides())
-    assert link.endswith("</a>ᴬᵁᴿ")
+    assert link.endswith("</a><sup><small>AUR</small></sup>")
     assert OFFICIAL_BASE not in link
 
     # Remove AUR provider and add official one
-- 
GitLab