Run pandoc on text instead of file

This commit is contained in:
2024-10-05 18:13:49 +02:00
parent 47420cbe41
commit 7825f62fa2
3 changed files with 4 additions and 5 deletions

View File

@@ -51,8 +51,7 @@ evalFunctionIO f x = case (f, x) of
createDirectory s
pure Empty
(RunPandoc, String (StringWrapper s)) -> do
contents <- T.readFile s
(RunPandoc, Text contents) -> do
html <- P.runIOorExplode (P.writeHtml5 P.def =<< P.readMarkdown (P.def { P.readerExtensions = P.extensionsFromList [ P.Ext_raw_html ] }) contents)
pure $ Text $ TL.toStrict $ B.renderHtml html