@@ -100,8 +100,8 @@ notesToRST notes =
100noteToRST :: Int -> [Block] -> State WriterState Doc
100noteToRST :: Int -> [Block] -> State WriterState Doc
101noteToRST num note = do
101noteToRST num note = do
102 contents <- blockListToRST note
102 contents <- blockListToRST note
103− let marker = text ".. [" <> text (show num) <> text "] "
103+ let marker = text ".. [" <> text (show num) <> text "]"
104− return $ hang marker 3 contents
104+ return $ marker $$ nest 3 contents
106-- | Return RST representation of picture reference table.
106-- | Return RST representation of picture reference table.
107pictTableToRST :: KeyTable -> State WriterState Doc
107pictTableToRST :: KeyTable -> State WriterState Doc
@@ -169,7 +169,7 @@ blockToRST (Para inlines) = do
169 return $ contents <> text "\n"
169 return $ contents <> text "\n"
170blockToRST (RawHtml str) =
170blockToRST (RawHtml str) =
171 let str' = if "\n" `isSuffixOf` str then str ++ "\n" else str ++ "\n\n" in
171 let str' = if "\n" `isSuffixOf` str then str ++ "\n" else str ++ "\n\n" in
172− return $ hang (text "\n.. raw:: html\n") 3 $ vcat $ map text (lines str')
172+ return $ (text "\n.. raw:: html\n") $$ (nest 3 $ vcat $ map text (lines str'))
173blockToRST HorizontalRule = return $ text "--------------\n"
173blockToRST HorizontalRule = return $ text "--------------\n"
174blockToRST (Header level inlines) = do
174blockToRST (Header level inlines) = do
175 contents <- inlineListToRST inlines
175 contents <- inlineListToRST inlines
@@ -236,7 +236,7 @@ blockToRST (DefinitionList items) = do
236bulletListItemToRST :: [Block] -> State WriterState Doc
236bulletListItemToRST :: [Block] -> State WriterState Doc
237bulletListItemToRST items = do
237bulletListItemToRST items = do
238 contents <- blockListToRST items
238 contents <- blockListToRST items
239− return $ hang (text "- ") 3 contents
239+ return $ (text "- ") <> contents
241-- | Convert ordered list item (a list of blocks) to RST.
241-- | Convert ordered list item (a list of blocks) to RST.
242orderedListItemToRST :: String -- ^ marker for list item
242orderedListItemToRST :: String -- ^ marker for list item
@@ -244,7 +244,7 @@ orderedListItemToRST :: String -- ^ marker for list item
244 -> State WriterState Doc
244 -> State WriterState Doc
245orderedListItemToRST marker items = do
245orderedListItemToRST marker items = do
246 contents <- blockListToRST items
246 contents <- blockListToRST items
247− return $ hang (text marker) (length marker + 1) contents
247+ return $ (text marker <> char ' ') <> contents
249-- | Convert defintion list item (label, list of blocks) to RST.
249-- | Convert defintion list item (label, list of blocks) to RST.
250definitionListItemToRST :: ([Inline], [Block]) -> State WriterState Doc
250definitionListItemToRST :: ([Inline], [Block]) -> State WriterState Doc