aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/CommonMark.hs43
-rw-r--r--test/command/6739.md21
2 files changed, 43 insertions, 21 deletions
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs
index 43db6d59a..c1773eaab 100644
--- a/src/Text/Pandoc/Readers/CommonMark.hs
+++ b/src/Text/Pandoc/Readers/CommonMark.hs
@@ -32,34 +32,35 @@ import Data.Functor.Identity (runIdentity)
readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
readCommonMark opts s = do
let res = runIdentity $
- commonmarkWith (foldr (<>) defaultSyntaxSpec exts) "input" s
+ commonmarkWith (foldr ($) defaultSyntaxSpec exts) "input" s
case res of
Left err -> throwError $ PandocParsecError s err
Right (Cm bls :: Cm () Blocks) -> return $ B.doc bls
where
- exts = [ hardLineBreaksSpec | isEnabled Ext_hard_line_breaks opts ] ++
- [ smartPunctuationSpec | isEnabled Ext_smart opts ] ++
- [ strikethroughSpec | isEnabled Ext_strikeout opts ] ++
- [ superscriptSpec | isEnabled Ext_superscript opts ] ++
- [ subscriptSpec | isEnabled Ext_subscript opts ] ++
- [ mathSpec | isEnabled Ext_tex_math_dollars opts ] ++
- [ fancyListSpec | isEnabled Ext_fancy_lists opts ] ++
- [ fencedDivSpec | isEnabled Ext_fenced_divs opts ] ++
- [ bracketedSpanSpec | isEnabled Ext_bracketed_spans opts ] ++
- [ rawAttributeSpec | isEnabled Ext_raw_attribute opts ] ++
- [ attributesSpec | isEnabled Ext_attributes opts ] ++
- [ pipeTableSpec | isEnabled Ext_pipe_tables opts ] ++
- [ autolinkSpec | isEnabled Ext_autolink_bare_uris opts ] ++
- [ emojiSpec | isEnabled Ext_emoji opts ] ++
- [ autoIdentifiersSpec
+ exts = [ (hardLineBreaksSpec <>) | isEnabled Ext_hard_line_breaks opts ] ++
+ [ (smartPunctuationSpec <>) | isEnabled Ext_smart opts ] ++
+ [ (strikethroughSpec <>) | isEnabled Ext_strikeout opts ] ++
+ [ (superscriptSpec <>) | isEnabled Ext_superscript opts ] ++
+ [ (subscriptSpec <>) | isEnabled Ext_subscript opts ] ++
+ [ (mathSpec <>) | isEnabled Ext_tex_math_dollars opts ] ++
+ [ (fancyListSpec <>) | isEnabled Ext_fancy_lists opts ] ++
+ [ (fencedDivSpec <>) | isEnabled Ext_fenced_divs opts ] ++
+ [ (bracketedSpanSpec <>) | isEnabled Ext_bracketed_spans opts ] ++
+ [ (rawAttributeSpec <>) | isEnabled Ext_raw_attribute opts ] ++
+ [ (attributesSpec <>) | isEnabled Ext_attributes opts ] ++
+ [ (<> pipeTableSpec) | isEnabled Ext_pipe_tables opts ] ++
+ -- see #6739
+ [ (autolinkSpec <>) | isEnabled Ext_autolink_bare_uris opts ] ++
+ [ (emojiSpec <>) | isEnabled Ext_emoji opts ] ++
+ [ (autoIdentifiersSpec <>)
| isEnabled Ext_gfm_auto_identifiers opts
, not (isEnabled Ext_ascii_identifiers opts) ] ++
- [ autoIdentifiersAsciiSpec
+ [ (autoIdentifiersAsciiSpec <>)
| isEnabled Ext_gfm_auto_identifiers opts
, isEnabled Ext_ascii_identifiers opts ] ++
- [ implicitHeadingReferencesSpec
+ [ (implicitHeadingReferencesSpec <>)
| isEnabled Ext_implicit_header_references opts ] ++
- [ footnoteSpec | isEnabled Ext_footnotes opts ] ++
- [ definitionListSpec | isEnabled Ext_definition_lists opts ] ++
- [ taskListSpec | isEnabled Ext_task_lists opts ]
+ [ (footnoteSpec <>) | isEnabled Ext_footnotes opts ] ++
+ [ (definitionListSpec <>) | isEnabled Ext_definition_lists opts ] ++
+ [ (taskListSpec <>) | isEnabled Ext_task_lists opts ]
diff --git a/test/command/6739.md b/test/command/6739.md
new file mode 100644
index 000000000..7c9ed24a2
--- /dev/null
+++ b/test/command/6739.md
@@ -0,0 +1,21 @@
+```
+% pandoc -f gfm
+* `--argument` This item does not have a pipe character
+* `--argA | --argB` This item has a pipe character
+^D
+<ul>
+<li><code>--argument</code> This item does not have a pipe character</li>
+<li><code>--argA | --argB</code> This item has a pipe character</li>
+</ul>
+```
+
+```
+% pandoc --mathjax -f gfm+tex_math_dollars
+* $|x|$
+* $|y|$
+^D
+<ul>
+<li><span class="math inline">\(|x|\)</span></li>
+<li><span class="math inline">\(|y|\)</span></li>
+</ul>
+```