diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-12-29 19:51:08 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-12-29 19:52:06 -0800 |
commit | b27783e2ecf5715c9bdf209793a67380a87e65b5 (patch) | |
tree | 890328540ef2a619eb10b7a8a5885a40aa61fe72 /src/Text/Pandoc/Writers | |
parent | 59d6f02a9af4ea47d001c84527df77f26d2d1fdd (diff) | |
download | pandoc-b27783e2ecf5715c9bdf209793a67380a87e65b5.tar.gz |
Use cmark 0.5.
Closes #2605.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/CommonMark.hs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs index a786dfd24..262f491a8 100644 --- a/src/Text/Pandoc/Writers/CommonMark.hs +++ b/src/Text/Pandoc/Writers/CommonMark.hs @@ -97,8 +97,8 @@ blockToNodes (Para xs) = (node PARAGRAPH (inlinesToNodes xs) :) blockToNodes (CodeBlock (_,classes,_) xs) = (node (CODE_BLOCK (T.pack (unwords classes)) (T.pack xs)) [] :) blockToNodes (RawBlock fmt xs) - | fmt == Format "html" = (node (HTML (T.pack xs)) [] :) - | otherwise = id + | fmt == Format "html" = (node (HTML_BLOCK (T.pack xs)) [] :) + | otherwise = (node (CUSTOM_BLOCK (T.pack xs) (T.empty)) [] :) blockToNodes (BlockQuote bs) = (node BLOCK_QUOTE (blocksToNodes bs) :) blockToNodes (BulletList items) = @@ -116,8 +116,8 @@ blockToNodes (OrderedList (start, _sty, delim) items) = _ -> PERIOD_DELIM, listTight = isTightList items, listStart = start }) (map (node ITEM . blocksToNodes) items) :) -blockToNodes HorizontalRule = (node HRULE [] :) -blockToNodes (Header lev _ ils) = (node (HEADER lev) (inlinesToNodes ils) :) +blockToNodes HorizontalRule = (node THEMATIC_BREAK [] :) +blockToNodes (Header lev _ ils) = (node (HEADING lev) (inlinesToNodes ils) :) blockToNodes (Div _ bs) = (blocksToNodes bs ++) blockToNodes (DefinitionList items) = blockToNodes (BulletList items') where items' = map dlToBullet items @@ -128,7 +128,7 @@ blockToNodes (DefinitionList items) = blockToNodes (BulletList items') dlToBullet (term, xs) = Para term : concat xs blockToNodes t@(Table _ _ _ _ _) = - (node (HTML (T.pack $! writeHtmlString def $! Pandoc nullMeta [t])) [] :) + (node (HTML_BLOCK (T.pack $! writeHtmlString def $! Pandoc nullMeta [t])) [] :) blockToNodes Null = id inlinesToNodes :: [Inline] -> [Node] @@ -142,25 +142,25 @@ inlineToNodes SoftBreak = (node SOFTBREAK [] :) inlineToNodes (Emph xs) = (node EMPH (inlinesToNodes xs) :) inlineToNodes (Strong xs) = (node STRONG (inlinesToNodes xs) :) inlineToNodes (Strikeout xs) = - ((node (INLINE_HTML (T.pack "<s>")) [] : inlinesToNodes xs ++ - [node (INLINE_HTML (T.pack "</s>")) []]) ++ ) + ((node (HTML_INLINE (T.pack "<s>")) [] : inlinesToNodes xs ++ + [node (HTML_INLINE (T.pack "</s>")) []]) ++ ) inlineToNodes (Superscript xs) = - ((node (INLINE_HTML (T.pack "<sup>")) [] : inlinesToNodes xs ++ - [node (INLINE_HTML (T.pack "</sup>")) []]) ++ ) + ((node (HTML_INLINE (T.pack "<sup>")) [] : inlinesToNodes xs ++ + [node (HTML_INLINE (T.pack "</sup>")) []]) ++ ) inlineToNodes (Subscript xs) = - ((node (INLINE_HTML (T.pack "<sub>")) [] : inlinesToNodes xs ++ - [node (INLINE_HTML (T.pack "</sub>")) []]) ++ ) + ((node (HTML_INLINE (T.pack "<sub>")) [] : inlinesToNodes xs ++ + [node (HTML_INLINE (T.pack "</sub>")) []]) ++ ) inlineToNodes (SmallCaps xs) = - ((node (INLINE_HTML (T.pack "<span style=\"font-variant:small-caps;\">")) [] + ((node (HTML_INLINE (T.pack "<span style=\"font-variant:small-caps;\">")) [] : inlinesToNodes xs ++ - [node (INLINE_HTML (T.pack "</span>")) []]) ++ ) + [node (HTML_INLINE (T.pack "</span>")) []]) ++ ) inlineToNodes (Link _ ils (url,tit)) = (node (LINK (T.pack url) (T.pack tit)) (inlinesToNodes ils) :) inlineToNodes (Image _ ils (url,tit)) = (node (IMAGE (T.pack url) (T.pack tit)) (inlinesToNodes ils) :) inlineToNodes (RawInline fmt xs) - | fmt == Format "html" = (node (INLINE_HTML (T.pack xs)) [] :) - | otherwise = id + | fmt == Format "html" = (node (HTML_INLINE (T.pack xs)) [] :) + | otherwise = (node (CUSTOM_INLINE (T.pack xs) (T.empty)) [] :) inlineToNodes (Quoted qt ils) = ((node (TEXT start) [] : inlinesToNodes ils ++ [node (TEXT end) []]) ++) where (start, end) = case qt of @@ -170,9 +170,9 @@ inlineToNodes (Code _ str) = (node (CODE (T.pack str)) [] :) inlineToNodes (Math mt str) = case mt of InlineMath -> - (node (INLINE_HTML (T.pack ("\\(" ++ str ++ "\\)"))) [] :) + (node (HTML_INLINE (T.pack ("\\(" ++ str ++ "\\)"))) [] :) DisplayMath -> - (node (INLINE_HTML (T.pack ("\\[" ++ str ++ "\\]"))) [] :) + (node (HTML_INLINE (T.pack ("\\[" ++ str ++ "\\]"))) [] :) inlineToNodes (Span _ ils) = (inlinesToNodes ils ++) inlineToNodes (Cite _ ils) = (inlinesToNodes ils ++) inlineToNodes (Note _) = id -- should not occur |