_includes/figure: Replace remove:<p> with strip_html, fix #4841

This commit is contained in:
iBug 2024-05-15 00:46:41 +08:00
parent 536e89d174
commit 4efb8638c4
3 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## Unreleased
### Bug Fixes
- Figure helper breaks when using code markup in caption. [#4841](https://github.com/mmistakes/minimal-mistakes/issues/4841)
## [4.26.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.26.1)
### Bug Fixes

View File

@ -1,5 +1,5 @@
<figure class="{{ include.class }}">
{%- if include.popup -%}<a href="{{ include.image_path | relative_url }}" class="image-popup" title="{% if include.caption %}{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}{% endif %}">{%- endif -%}
{%- if include.popup -%}<a href="{{ include.image_path | relative_url }}" class="image-popup"{% if include.caption %} title="{{ include.caption | markdownify | strip_html }}"{% endif %}>{%- endif -%}
<img src="{{ include.image_path | relative_url }}"
alt="{% if include.alt %}{{ include.alt }}{% endif %}">
{%- if include.popup -%}</a>{%- endif -%}

View File

@ -5,7 +5,7 @@ permalink: "/docs/history/"
excerpt: Change log of enhancements and bug fixes made to the theme.
sidebar:
nav: docs
last_modified_at: '2024-05-10T18:00:47+08:00'
last_modified_at: '2024-05-15T00:46:38+08:00'
toc: false
---
@ -15,6 +15,12 @@ toc: false
-->
{% raw %}
## Unreleased
### Bug Fixes
- Figure helper breaks when using code markup in caption. [#4841](https://github.com/mmistakes/minimal-mistakes/issues/4841)
## [4.26.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.26.1)
### Bug Fixes