aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-16 22:16:41 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-16 22:16:41 +0100
commitc93d069d49fcf724fc59405b82587d608724c2c6 (patch)
treeac4e8f7bd9168ff13c42991f00d43ffb7b33bd26 /src
parent2fe806e9ac54a6733222df9369c890b92df92ff4 (diff)
downloadpandoc-c93d069d49fcf724fc59405b82587d608724c2c6.tar.gz
Add default abbreviations file (data/abbreviations).
This contains a list of strings that will be recognized by pandoc's Markdown parser as abbreviations. (A nonbreaking space will be inserted after the period, preventing a sentence space in formats like LaTeX.) Users can override the default by putting a file abbreviations in their user data directory (`~/.pandoc` on *nix).
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 9c2e076c5..34eadb6e0 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -280,10 +280,10 @@ convertWithOpts opts = do
uriFragment = "" }
_ -> Nothing
- abbrevs <- case optAbbreviations opts of
- Nothing -> return $ readerAbbreviations def
- Just f -> (Set.fromList . filter (not . null) . lines)
- <$> UTF8.readFile f
+ abbrevs <- (Set.fromList . filter (not . null) . lines) <$>
+ case optAbbreviations opts of
+ Nothing -> readDataFileUTF8 datadir "abbreviations"
+ Just f -> UTF8.readFile f
let readerOpts = def{ readerStandalone = standalone
, readerColumns = optColumns opts