diff options
author | Anthony Fok <foka@debian.org> | 2015-08-05 16:39:29 -0600 |
---|---|---|
committer | Anthony Fok <foka@debian.org> | 2015-10-30 13:30:25 -0600 |
commit | e95db67b20163c8ab43f4a652b9b6dc7dc13a230 (patch) | |
tree | cc50dec2478bbb695c45c0955971dcd8fed6547b /helpers/content.go | |
parent | 6b34a4e4e8a18e1f78a5727e583638a6bb247f4f (diff) |
Add smartDashes flag for Blackfriday
To allow the end users to disable any form of smart dashes
(LaTeX-style or not) while keeping the rest of Blackfriday
SmartyPants features.
Depends on https://github.com/russross/blackfriday/pull/190
"Add HTML_SMARTYPANTS_DASHES for toggling smart dashes"
to be accepted by Blackfriday developers.
Diffstat (limited to 'helpers/content.go')
-rw-r--r-- | helpers/content.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/helpers/content.go b/helpers/content.go index 847d4dcbc..b42efaefe 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -45,6 +45,7 @@ type Blackfriday struct { AngledQuotes bool Fractions bool HrefTargetBlank bool + SmartDashes bool LatexDashes bool PlainIDAnchors bool Extensions []string @@ -58,6 +59,7 @@ func NewBlackfriday() *Blackfriday { AngledQuotes: false, Fractions: true, HrefTargetBlank: false, + SmartDashes: true, LatexDashes: true, PlainIDAnchors: false, } @@ -169,6 +171,10 @@ func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Render htmlFlags |= blackfriday.HTML_HREF_TARGET_BLANK } + if ctx.getConfig().SmartDashes { + htmlFlags |= blackfriday.HTML_SMARTYPANTS_DASHES + } + if ctx.getConfig().LatexDashes { htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES } |