From c93d069d49fcf724fc59405b82587d608724c2c6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 16 Mar 2017 22:16:41 +0100 Subject: 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). --- src/Text/Pandoc/App.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3