Escape page metadata in post template (#884)

This commit is contained in:
Zixuan Tan 2025-04-09 01:40:02 +08:00 committed by GitHub
parent 13cc3171de
commit ae14cd177c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,8 +19,8 @@
</span>
<span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="name" content="{{ page.title + ' | ' + title }}">
<meta itemprop="description" content="{{ page.description }}">
<meta itemprop="name" content="{{ escape_html(page.title or '') + ' | ' + title }}">
<meta itemprop="description" content="{{ escape_html(page.description or '') }}">
</span>
{%- if post.header !== false %}
@ -134,14 +134,14 @@
<div class="post-nav">
<div class="post-nav-item">
{%- if prev %}
<a href="{{ url_for(prev.path) }}" rel="prev" title="{{ prev.title }}">
<a href="{{ url_for(prev.path) }}" rel="prev" title="{{ escape_html(prev.title or '') }}">
<i class="fa fa-angle-left"></i> {{ prev.title }}
</a>
{%- endif %}
</div>
<div class="post-nav-item">
{%- if next %}
<a href="{{ url_for(next.path) }}" rel="next" title="{{ next.title }}">
<a href="{{ url_for(next.path) }}" rel="next" title="{{ escape_html(next.title or '') }}">
{{ next.title }} <i class="fa fa-angle-right"></i>
</a>
{%- endif %}