From 64cd872ba5c59b726529cf4a98ac3b90276db07f Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Thu, 1 Feb 2024 18:33:17 -0800 Subject: [PATCH] Fix article image alt attribute PR #252 dropped the alt text to support HTML in the image credits, but a more accessible fix here is just strip the HTML from the image credits when using the credits in the attribute. --- readthedocs_theme/templates/article.html | 2 +- readthedocs_theme/templates/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs_theme/templates/article.html b/readthedocs_theme/templates/article.html index c40d71e4..7406ee94 100644 --- a/readthedocs_theme/templates/article.html +++ b/readthedocs_theme/templates/article.html @@ -53,7 +53,7 @@
- {{ article.image }} + {{ article.image_credit|striptags }} {% if article.image and article.image_credit %}

{{ article.image_credit}}

diff --git a/readthedocs_theme/templates/index.html b/readthedocs_theme/templates/index.html index 133bb3f5..bb438f94 100644 --- a/readthedocs_theme/templates/index.html +++ b/readthedocs_theme/templates/index.html @@ -8,7 +8,7 @@ {% macro article_card(article) %}
- {{ article.image }} + {{ article.image_credit|striptags }}
{{ article.title }}