From 40b2ca6027f739b01903f5e89eb679f28009c00a Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Sat, 24 Jan 2015 12:37:02 -0700 Subject: [PATCH] Add site-wide/per-page [blackfriday] `fractions` option Make Blackfriday's `HTML_SMARTYPANTS_FRACTIONS` option user-configurable. Defaults to `true` as before. See discussions at: http://discuss.gohugo.io/t/any-way-to-disable-smart-fractions/328 Thanks to @bjornerik and @spf13 for laying the groundwork making it easy to expose Blackfriday's underlying configurable options. --- content/overview/configuration.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/content/overview/configuration.md b/content/overview/configuration.md index 4e4b750c1..a07ef5672 100644 --- a/content/overview/configuration.md +++ b/content/overview/configuration.md @@ -91,6 +91,21 @@ But Hugo does expose some options---as listed in the table below, matched with t Enable smart angled double quotes (e.g. "Hugo" renders to «Hugo» instead of “Hugo”) + +fractions +true +HTML_SMARTYPANTS_FRACTIONS + + +Purpose: +Enable smart fractions +(e.g. 5/12 renders to 512 (<sup>5</sup>&frasl;<sub>12</sub>)) +Caveat: Even with fractions = false, +Blackfriday would still convert 1/2, 1/4 and 3/4 to ½ (&frac12;), +¼ (&frac14;) and ¾ (&frac34;) respectively, +but only these three. + + plainIdAnchors false @@ -112,11 +127,13 @@ But Hugo does expose some options---as listed in the table below, matched with t
[blackfriday]
-    angledQuotes = true
-    plainIdAnchors = true
+  angledQuotes = true
+  fractions = false
+  plainIdAnchors = true
 
blackfriday:
   angledQuotes: true
+  fractions: false
   plainIdAnchors: true