mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add Typogrify/SmartyPants dashes config parameter (#2615)
This commit is contained in:
parent
cb3bb4ad69
commit
f610801ee8
7 changed files with 101 additions and 0 deletions
|
|
@ -585,6 +585,14 @@ class Readers(FileStampDataCacher):
|
|||
from typogrify.filters import typogrify
|
||||
import smartypants
|
||||
|
||||
typogrify_dashes = self.settings['TYPOGRIFY_DASHES']
|
||||
if typogrify_dashes == 'oldschool':
|
||||
smartypants.Attr.default = smartypants.Attr.set2
|
||||
elif typogrify_dashes == 'oldschool_inverted':
|
||||
smartypants.Attr.default = smartypants.Attr.set3
|
||||
else:
|
||||
smartypants.Attr.default = smartypants.Attr.set1
|
||||
|
||||
# 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue