Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
decker
decker
Commits
2b967b9c
Commit
2b967b9c
authored
Nov 30, 2018
by
Jan-Philipp Stauffert
Browse files
Add utf8 reading and writing of md and html respective
parent
c315ffe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Utilities.hs
View file @
2b967b9c
...
...
@@ -247,7 +247,7 @@ writePandocFile fmt options out pandoc =
case
getWriter
fmt
of
Right
(
TextWriter
writePandoc
,
_
)
->
runIOQuietly
(
writePandoc
options
pandoc
)
>>=
handleError
>>=
T
.
writeFile
out
B
.
writeFile
out
.
E
.
encodeUtf8
Right
(
ByteStringWriter
writePandoc
,
_
)
->
runIOQuietly
(
writePandoc
options
pandoc
)
>>=
handleError
>>=
LB
.
writeFile
out
...
...
@@ -494,7 +494,7 @@ readMetaMarkdown markdownFile = do
externalMeta
<-
liftIO
$
aggregateMetaData
projectDir
(
takeDirectory
markdownFile
)
-- extract embedded meta data from the document
markdown
<-
liftIO
$
T
.
readFile
markdownFile
markdown
<-
liftIO
$
E
.
decodeUtf8
<$>
B
.
readFile
markdownFile
let
Pandoc
meta
_
=
readMarkdownOrThrow
pandocReaderOpts
markdown
let
documentMeta
=
MetaMap
$
unMeta
meta
-- combine the meta data with preference on the embedded data
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment