@@ -100,8 +100,8 @@ notesToRST notes =
100100noteToRST :: Int -> [Block] -> State WriterState Doc
101101noteToRST num note = do
102102 contents <- blockListToRST note
103− let marker = text ".. [" <> text (show num) <> text "] "
104− return $ hang marker 3 contents
103+ let marker = text ".. [" <> text (show num) <> text "]"
104+ return $ marker $$ nest 3 contents
105105
106106-- | Return RST representation of picture reference table.
107107pictTableToRST :: KeyTable -> State WriterState Doc
@@ -169,7 +169,7 @@ blockToRST (Para inlines) = do
169169 return $ contents <> text "\n"
170170blockToRST (RawHtml str) =
171171 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'))
173173blockToRST HorizontalRule = return $ text "--------------\n"
174174blockToRST (Header level inlines) = do
175175 contents <- inlineListToRST inlines
@@ -236,7 +236,7 @@ blockToRST (DefinitionList items) = do
236236bulletListItemToRST :: [Block] -> State WriterState Doc
237237bulletListItemToRST items = do
238238 contents <- blockListToRST items
239− return $ hang (text "- ") 3 contents
239+ return $ (text "- ") <> contents
240240
241241-- | Convert ordered list item (a list of blocks) to RST.
242242orderedListItemToRST :: String -- ^ marker for list item
@@ -244,7 +244,7 @@ orderedListItemToRST :: String -- ^ marker for list item
244244 -> State WriterState Doc
245245orderedListItemToRST marker items = do
246246 contents <- blockListToRST items
247− return $ hang (text marker) (length marker + 1) contents
247+ return $ (text marker <> char ' ') <> contents
248248
249249-- | Convert defintion list item (label, list of blocks) to RST.
250250definitionListItemToRST :: ([Inline], [Block]) -> State WriterState Doc