diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-04-04 15:43:47 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-04-04 15:43:47 -0700 |
commit | 036576c5a2660897e1c977407c621c8c436b7600 (patch) | |
tree | 488e5df7ad1031071258075e77f6747b1c980799 /src/Text | |
parent | e97217f234592236f0ad1062fb23fffbe440702a (diff) | |
download | pandoc-036576c5a2660897e1c977407c621c8c436b7600.tar.gz |
Correctly handle UTF-8 in custom lua scripts. Closes #1189.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Custom.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index 0d58afb61..0b30287f5 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -37,7 +37,6 @@ import Data.Char ( toLower ) import Scripting.Lua (LuaState, StackValue, callfunc) import qualified Scripting.Lua as Lua import Text.Pandoc.UTF8 (fromString, toString) -import qualified Text.Pandoc.UTF8 as UTF8 import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as C8 import Data.Monoid @@ -132,7 +131,7 @@ instance StackValue MetaValue where -- | Convert Pandoc to custom markup. writeCustom :: FilePath -> WriterOptions -> Pandoc -> IO String writeCustom luaFile opts doc = do - luaScript <- UTF8.readFile luaFile + luaScript <- C8.unpack `fmap` C8.readFile luaFile lua <- Lua.newstate Lua.openlibs lua Lua.loadstring lua luaScript "custom" |