Markdown writer: escape initial % in a paragraph...
...if the `pandoc_title_blocks` extension is enabled. Otherwise in a document starting with a literal percent sign the first line is wrongly interpreted as a title. Closes #3454.
This commit is contained in:
parent
6530bc4471
commit
aeb11cea4e
1 changed files with 5 additions and 1 deletions
|
@ -405,7 +405,11 @@ blockToMarkdown' opts (Plain inlines) = do
|
|||
not isPlain && beginsWithOrderedListMarker rendered
|
||||
then text $ escapeDelimiter rendered
|
||||
else contents
|
||||
return $ contents' <> cr
|
||||
-- escape if para starts with %
|
||||
return $
|
||||
if isEnabled Ext_pandoc_title_block opts && take 1 rendered == "%"
|
||||
then "\\" <> contents' <> cr
|
||||
else contents' <> cr
|
||||
-- title beginning with fig: indicates figure
|
||||
blockToMarkdown' opts (Para [Image attr alt (src,'f':'i':'g':':':tit)]) =
|
||||
blockToMarkdown opts (Para [Image attr alt (src,tit)])
|
||||
|
|
Loading…
Add table
Reference in a new issue