@@ -48,18 +48,14 @@ import Text.Pandoc.Walk (walkM)
4848-- | Parse a CommonMark formatted string into a 'Pandoc' structure.
4949readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
5050readCommonMark opts s = return $
51− (if enabled Ext_gfm_auto_identifiers opts
51+ (if isEnabled Ext_gfm_auto_identifiers opts
5252 then addHeaderIdentifiers
5353 else id) $
5454 nodeToPandoc opts $ commonmarkToNode opts' exts s
55− where opts' = [ optSmart | enabled Ext_smart opts ]
56− exts = [ extStrikethrough | enabled Ext_strikeout opts ] ++
57− [ extTable | enabled Ext_pipe_tables opts ] ++
58− [ extAutolink | enabled Ext_autolink_bare_uris opts ]
59−
60−-- | Returns True if the given extension is enabled.
61−enabled :: Extension -> ReaderOptions -> Bool
62−enabled ext opts = ext `extensionEnabled` readerExtensions opts
55+ where opts' = [ optSmart | isEnabled Ext_smart opts ]
56+ exts = [ extStrikethrough | isEnabled Ext_strikeout opts ] ++
57+ [ extTable | isEnabled Ext_pipe_tables opts ] ++
58+ [ extAutolink | isEnabled Ext_autolink_bare_uris opts ]
6359
6460convertEmojis :: String -> String
6561convertEmojis (':':xs) =
@@ -112,7 +108,7 @@ addBlock _ (Node _ THEMATIC_BREAK _) =
112108addBlock opts (Node _ BLOCK_QUOTE nodes) =
113109 (BlockQuote (addBlocks opts nodes) :)
114110addBlock opts (Node _ (HTML_BLOCK t) _)
115− | enabled Ext_raw_html opts = (RawBlock (Format "html") (unpack t) :)
111+ | isEnabled Ext_raw_html opts = (RawBlock (Format "html") (unpack t) :)
116112 | otherwise = id
117113-- Note: the cmark parser will never generate CUSTOM_BLOCK,
118114-- so we don't need to handle it:
@@ -210,15 +206,15 @@ addInline opts (Node _ (TEXT t) _) = (map toinl clumps ++)
210206 samekind _ ' ' = False
211207 samekind _ _ = True
212208 toinl (' ':_) = Space
213− toinl xs = Str $ if enabled Ext_emoji opts
209+ toinl xs = Str $ if isEnabled Ext_emoji opts
214210 then convertEmojis xs
215211 else xs
216212addInline _ (Node _ LINEBREAK _) = (LineBreak :)
217213addInline opts (Node _ SOFTBREAK _)
218− | enabled Ext_hard_line_breaks opts = (LineBreak :)
214+ | isEnabled Ext_hard_line_breaks opts = (LineBreak :)
219215 | otherwise = (SoftBreak :)
220216addInline opts (Node _ (HTML_INLINE t) _)
221− | enabled Ext_raw_html opts = (RawInline (Format "html") (unpack t) :)
217+ | isEnabled Ext_raw_html opts = (RawInline (Format "html") (unpack t) :)
222218 | otherwise = id
223219-- Note: the cmark parser will never generate CUSTOM_BLOCK,
224220-- so we don't need to handle it: