From 8e53489cbca3f230eed94294af3810d2447db2af Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 Nov 2017 10:35:52 -0700 Subject: Fix strikethrough in gfm writer. Previously we got a crash, because we were trying to print a native cmark STRIKETHROUGH node, and the commonmark writer in cmark-github doesn't support this. Work around this by using a raw node to add the strikethrough delimiters. Closes #4038. --- src/Text/Pandoc/Writers/CommonMark.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs index e6d297291..8677dd840 100644 --- a/src/Text/Pandoc/Writers/CommonMark.hs +++ b/src/Text/Pandoc/Writers/CommonMark.hs @@ -242,7 +242,7 @@ inlineToNodes opts (Emph xs) = (node EMPH (inlinesToNodes opts xs) :) inlineToNodes opts (Strong xs) = (node STRONG (inlinesToNodes opts xs) :) inlineToNodes opts (Strikeout xs) = if isEnabled Ext_strikeout opts - then (node STRIKETHROUGH (inlinesToNodes opts xs) :) + then (node (CUSTOM_INLINE "~~" "~~") (inlinesToNodes opts xs) :) else ((node (HTML_INLINE (T.pack "")) [] : inlinesToNodes opts xs ++ [node (HTML_INLINE (T.pack "")) []]) ++ ) inlineToNodes opts (Superscript xs) = -- cgit v1.2.3