getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.58k stars 1.81k forks source link

Typogrify should not be applied in readers #612

Closed erfaan closed 11 years ago

erfaan commented 11 years ago

Lets assume following title:

"Jayhawks" & KU fans act extremely obnoxiously

After applying typogrify:

<span class="dquo">&#8220;</span>Jayhawks&#8221; <span class="amp">&amp;</span> <span class="caps">KU</span> fans act extremely&nbsp;obnoxiously

Now this result cannot be used as an attribute to a tag. Take example from the simple template:

<h2 class="entry-title">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">{{ article.title }}</a>
</h2>

The result would be:

<h2 class="entry-title">
<a href="./somelink.html" rel="bookmark" title="Permalink to <span class="dquo">&#8220;</span>Jayhawks&#8221; <span class="amp">&amp;</span> <span class="caps">KU</span> fans act extremely&nbsp;obnoxiously">
<span class="dquo">&#8220;</span>Jayhawks&#8221; <span class="amp">&amp;</span> <span class="caps">KU</span> fans act extremely&nbsp;obnoxiously</a>
</h2>

As you can see that the attribute title contains html within it which disturbs the output rendered.

justinmayer commented 11 years ago

Thank you for the bug report. Commit a0049f9 should address the errant behavior. If the problem persists, please re-open this issue and include detailed steps to reproduce.