Tell smartypants to also process " entities

This is necessary because Docutils has already replaced double quotes
with " HTML entities by the time the typogrify filter is applied.
This commit is contained in:
John Mastro 2015-02-12 16:24:59 -08:00
commit 0949fa62ec
2 changed files with 10 additions and 3 deletions

View file

@ -467,6 +467,13 @@ class Readers(FileStampDataCacher):
# eventually filter the content with typogrify if asked so
if self.settings['TYPOGRIFY']:
from typogrify.filters import typogrify
import smartypants
# Tell `smartypants` to also replace " HTML entities with
# smart quotes. This is necessary because Docutils has already
# replaced double quotes with said entities by the time we run
# this filter.
smartypants.Attr.default |= smartypants.Attr.w
def typogrify_wrapper(text):
"""Ensures ignore_tags feature is backward compatible"""