mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
9152e021e2
commit
0949fa62ec
2 changed files with 10 additions and 3 deletions
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue