diff options
| author | John MacFarlane <[email protected]> | 2022-01-03 18:50:44 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-01-03 18:50:44 -0800 |
| commit | 322364ff6610636a8b57755f5da1878aca0fc8e6 (patch) | |
| tree | 567abea0757213a0f9a0fe085eae3d8cf5bb939c /src | |
| parent | 53699f2ab3f9b6dce04ae44a0d0342cb78974bd1 (diff) | |
Markdown writer: fix indentation issue in footnotes.
Closes #7801.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 5e3e52ce5..e4eaae410 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -282,9 +282,13 @@ noteToMarkdown opts num blocks = do then literal "[^" <> num' <> literal "]:" else literal "[" <> num' <> literal "]" let markerSize = 4 + offset num' - let spacer = case writerTabStop opts - markerSize of - n | n > 0 -> literal $ T.replicate n " " - _ -> literal " " + let hspacer = case writerTabStop opts - markerSize of + n | n > 0 -> literal $ T.replicate n " " + _ -> literal " " + let spacer = case blocks of + Para{}:_ -> hspacer + Plain{}:_ -> hspacer + _ -> cr return $ if isEnabled Ext_footnotes opts then hang (writerTabStop opts) (marker <> spacer) contents else marker <> spacer <> contents |
