fix: missing xml escape for alt
of preview image (#1113)
Preview image display error when `alt` contains '<' or '>' Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
This commit is contained in:
parent
2639f8ed45
commit
8b0fbf5a83
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ refactor: true
|
|||
{% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %}
|
||||
{% endunless %}
|
||||
|
||||
{% assign alt = post.image.alt | default: 'Preview Image' %}
|
||||
{% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %}
|
||||
|
||||
<img src="{{ src }}" w="17" h="10" alt="{{ alt }}" {{ lqip }}>
|
||||
{% endif %}
|
||||
|
|
|
@ -31,7 +31,7 @@ tail_includes:
|
|||
{% if page.image %}
|
||||
{% capture src %}src="{{ page.image.path | default: page.image }}"{% endcapture %}
|
||||
{% capture class %}class="preview-img{% if page.image.no_bg %}{{ ' no-bg' }}{% endif %}"{% endcapture %}
|
||||
{% capture alt %}alt="{{ page.image.alt | default: "Preview Image" }}"{% endcapture %}
|
||||
{% capture alt %}alt="{{ page.image.alt | xml_escape | default: "Preview Image" }}"{% endcapture %}
|
||||
|
||||
{% capture lqip %}
|
||||
{% if page.image.lqip %}
|
||||
|
|
Loading…
Reference in a new issue