aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-10-23 13:35:10 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-10-23 13:35:49 +0300
commitec2d86e34f00d8605546b2b9c8df5d52a330a0b0 (patch)
treea62ddb115869eb4715336c677b752d02cf1912d0
parenta7819c644058eac142da3755d609e1f149753271 (diff)
downloadpandoc-ec2d86e34f00d8605546b2b9c8df5d52a330a0b0.tar.gz
Muse writer: use length instead of realLength to calculate definition indentation
Muse parsers don't take character width into account when calculating indentation.
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs3
1 files changed, 2 insertions, 1 deletions
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