diff options
| author | John MacFarlane <[email protected]> | 2025-09-24 21:32:08 +0200 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-09-24 21:32:31 +0200 |
| commit | 9024df9348ce38741777296a5845b39539a90acf (patch) | |
| tree | c079b3abd9745b4e3d40c60ad11b33c90a208fc2 /src | |
| parent | bdab9915ad01a4ee3542a15e4f43102b8a4e2a20 (diff) | |
RST writer: ensure blank line before directives.
Closes #11162.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 76c8d6fd0..8f4e7783e 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -251,8 +251,8 @@ blockToRST (Div (ident,classes,_kvs) bs) = do let admonition = case classes of (cl:_) | cl `elem` admonitions - -> ".. " <> literal cl <> "::" - cls -> ".. container::" <> space <> + -> blankline <> ".. " <> literal cl <> "::" + cls -> blankline <> ".. container::" <> space <> literal (T.unwords (filter (/= "container") cls)) -- if contents start with block quote, we need to insert -- an empty comment to fix the indentation point (#10236) @@ -323,7 +323,7 @@ blockToRST (CodeBlock (_,classes,kvs) str) = do c `notElem` ["sourceCode","literate","numberLines", "number-lines","example"]] of [] -> "::" - (lang:_) -> (".. code:: " <> literal lang) $$ numberlines) + (lang:_) -> (blankline <> ".. code:: " <> literal lang) $$ numberlines) $+$ nest 3 (literal str) $$ blankline blockToRST (BlockQuote blocks) = do contents <- blockListToRST blocks @@ -358,7 +358,7 @@ blockToRST (Table _attrs blkCapt specs thead tbody tfoot) = do return $ blankline $$ (if null caption || isList then tbl - else (".. table:: " <> caption') $$ blankline $$ nest 3 tbl) $$ + else (blankline <> ".. table:: " <> caption') $$ blankline $$ nest 3 tbl) $$ blankline blockToRST (BulletList items) = do contents <- mapM bulletListItemToRST items |
