Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 19 lines (12 sloc) 0.465 kb
1a3c231 @jgm Changed plugin names, made them all work.
authored
1 module Deprofanizer (plugin) where
905f8db Added Deprofanizer plugin; removed CapitalizePlugin.
John MacFarlane authored
2
3 -- This plugin replaces profane words with "XXXXX".
4
3da0cc8 @jgm Fixed plugins to use new Network.Gitit prefix.
authored
5 import Network.Gitit.Interface
905f8db Added Deprofanizer plugin; removed CapitalizePlugin.
John MacFarlane authored
6 import Data.Char (toLower)
7
8 plugin :: Plugin
9 plugin = mkPageTransform deprofanize
10
11 deprofanize :: Inline -> Inline
12 deprofanize (Str x) | isBadWord x = Str "XXXXX"
13 deprofanize x = x
14
15 isBadWord :: String -> Bool
112e8b0 @jgm Plugins: hlint and import cleanup (gwern).
authored
16 isBadWord x = map toLower x `elem` ["darn", "blasted", "stinker"]
905f8db Added Deprofanizer plugin; removed CapitalizePlugin.
John MacFarlane authored
17 -- there are more, but this is a family program
18
Something went wrong with that request. Please try again.