aboutsummaryrefslogtreecommitdiff
path: root/plugins/CapitalizeEmphasisPlugin.hs
blob: 80c667e050705576632d1b00f24c919a86c3fe12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module CapitalizeEmphasisPlugin (transform) where
import Text.Pandoc
import Data.Char (toUpper)

-- This plugin changes emphasized text into CAPITALIZED TEXT.

transform :: [Inline] -> [Inline]
transform (Emph x : ys) = processWith capStr x ++ transform ys
transform (x : ys)      = x : transform ys
transform []            = []

capStr :: Inline -> Inline
capStr (Str x) = Str (map toUpper x)
capStr x       = x