aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Ipynb.hs3
-rw-r--r--src/Text/Pandoc/Writers/Ipynb.hs7
2 files changed, 3 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs
index 056fa431c..a245bdad3 100644
--- a/src/Text/Pandoc/Readers/Ipynb.hs
+++ b/src/Text/Pandoc/Readers/Ipynb.hs
@@ -79,8 +79,7 @@ cellToBlocks opts lang c = do
case cellType c of
Ipynb.Markdown -> do
Pandoc _ bs <- walk fixImage <$> readMarkdown opts source
- let kvs' = ("source", source) : kvs
- return $ B.divWith ("",["cell","markdown"],kvs')
+ return $ B.divWith ("",["cell","markdown"],kvs)
$ B.fromList bs
Ipynb.Heading lev -> do
Pandoc _ bs <- readMarkdown opts
diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs
index 86e2abbdf..d01d5a7e5 100644
--- a/src/Text/Pandoc/Writers/Ipynb.hs
+++ b/src/Text/Pandoc/Writers/Ipynb.hs
@@ -102,13 +102,10 @@ extractCells _ [] = return []
extractCells opts (Div (_id,classes,kvs) xs : bs)
| "cell" `elem` classes
, "markdown" `elem` classes = do
- let meta = pairsToJSONMeta [(k,v) | (k,v) <- kvs, k /= "source"]
+ let meta = pairsToJSONMeta kvs
(newdoc, attachments) <-
runStateT (walkM addAttachment (Pandoc nullMeta xs)) mempty
- source <- case lookup "source" kvs of
- Just s -> return s
- Nothing -> writeMarkdown opts{ writerTemplate = Nothing }
- newdoc
+ source <- writeMarkdown opts{ writerTemplate = Nothing } newdoc
(Ipynb.Cell{
cellType = Markdown
, cellSource = Source $ breakLines $ T.stripEnd source