git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: use length instead of realLength to calculate definition indentation

Muse parsers don't take character width into account when calculating indentation.

commitec2d86e34f00d8605546b2b9c8df5d52a330a0b0 authorAlexander Krotov <ilabdsf@gmail.com> dateTue 23 Oct 2018, 13:35 (8 years ago) parenta7819c6
1 file changed+2−1
src/Text/Pandoc/Writers/Muse.hs+2−1
src/Text/Pandoc/Writers/Muse.hs+2−1
@@ -230,8 +230,9 @@ blockToMuse (DefinitionList items) = do
230230 definitionListItemToMuse (label, defs) = do
231231 modify $ \st -> st { stUseTags = False }
232232 label' <- local (\env -> env { envOneLine = True, envAfterSpace = True }) $ inlineListToMuse' label
233− let ind = offset label'
233+ let ind = offset' label' -- using Text.Pandoc.Pretty.offset results in round trip failures
234234 hang ind (nowrap label') . vcat <$> mapM descriptionToMuse defs
235+ where offset' d = maximum (0: map length (lines $ render Nothing d))
235236 descriptionToMuse :: PandocMonad m
236237 => [Block]
237238 -> Muse m Doc