Prevent double quotes within attribute value for article title

Replace double quotes with single quotes in the html attribute value for the article title, because otherwise, the resulting html may be invalid.
This commit is contained in:
Foo Chuan Wei 2017-11-15 00:07:26 -05:00 committed by GitHub
commit 73033751c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@
<ol id="post-list"> <ol id="post-list">
{% for article in articles_page.object_list %} {% for article in articles_page.object_list %}
<li><article class="hentry"> <li><article class="hentry">
<header> <h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2> </header> <header> <h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags|replace('"', "'") }}">{{ article.title }}</a></h2> </header>
<footer class="post-info"> <footer class="post-info">
<time class="published" datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time> <time class="published" datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time>
<address class="vcard author">By <address class="vcard author">By