From ec2d86e34f00d8605546b2b9c8df5d52a330a0b0 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 23 Oct 2018 13:35:10 +0300 Subject: Muse writer: use length instead of realLength to calculate definition indentation Muse parsers don't take character width into account when calculating indentation. --- src/Text/Pandoc/Writers/Muse.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 55d70c170..3c9c03be4 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -230,8 +230,9 @@ blockToMuse (DefinitionList items) = do definitionListItemToMuse (label, defs) = do modify $ \st -> st { stUseTags = False } label' <- local (\env -> env { envOneLine = True, envAfterSpace = True }) $ inlineListToMuse' label - let ind = offset label' + let ind = offset' label' -- using Text.Pandoc.Pretty.offset results in round trip failures hang ind (nowrap label') . vcat <$> mapM descriptionToMuse defs + where offset' d = maximum (0: map length (lines $ render Nothing d)) descriptionToMuse :: PandocMonad m => [Block] -> Muse m Doc -- cgit v1.2.3