Markdown writer: fix indentation issue in footnotes.

Closes #7801.
This commit is contained in:
John MacFarlane 2022-01-03 18:50:44 -08:00
parent 53699f2ab3
commit 322364ff66

View file

@ -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