aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-07-18 22:30:05 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-07-18 22:31:03 -0700
commit28cad165179378369fcf4d25656ea28357026baa (patch)
treed94b27ef8175fbdfaee04828bf5b6f64528acd4a /src/Text/Pandoc/Writers
parent5c655e86d5d34172bc5892927309d8dff6023493 (diff)
downloadpandoc-28cad165179378369fcf4d25656ea28357026baa.tar.gz
Markdown writer: prefer using raw_attribute when enabled.
The `raw_attribute` will be used to mark raw bits, even HTML and LaTeX, and even when `raw_html` and `raw_tex` are enabled, as they are by default. To get the old behavior, disable `raw_attribute` in the writer. Closes #4311.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 50fba2dba..ade350565 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -467,6 +467,7 @@ blockToMarkdown' opts b@(RawBlock f str) = do
let renderEmpty = mempty <$ report (BlockNotRendered b)
case () of
_ | plain -> renderEmpty
+ | isEnabled Ext_raw_attribute opts -> rawAttribBlock
| f `elem` ["markdown", "markdown_github", "markdown_phpextra",
"markdown_mmd", "markdown_strict"] ->
return $ text str <> text "\n"
@@ -484,7 +485,6 @@ blockToMarkdown' opts b@(RawBlock f str) = do
text str <> text "\n"
| isEnabled Ext_raw_attribute opts -> rawAttribBlock
| otherwise -> renderEmpty
- | isEnabled Ext_raw_attribute opts -> rawAttribBlock
| otherwise -> renderEmpty
blockToMarkdown' opts HorizontalRule = do
return $ blankline <> text (replicate (writerColumns opts) '-') <> blankline
@@ -1152,6 +1152,7 @@ inlineToMarkdown opts il@(RawInline f str) = do
| f `elem` ["markdown", "markdown_github", "markdown_phpextra",
"markdown_mmd", "markdown_strict"] ->
return $ text str
+ | isEnabled Ext_raw_attribute opts -> rawAttribInline
| f `elem` ["html", "html5", "html4"] ->
case () of
_ | isEnabled Ext_raw_html opts -> return $ text str
@@ -1162,7 +1163,6 @@ inlineToMarkdown opts il@(RawInline f str) = do
_ | isEnabled Ext_raw_tex opts -> return $ text str
| isEnabled Ext_raw_attribute opts -> rawAttribInline
| otherwise -> renderEmpty
- | isEnabled Ext_raw_attribute opts -> rawAttribInline
| otherwise -> renderEmpty
inlineToMarkdown opts (LineBreak) = do
plain <- asks envPlain