From fee0b913c5dd95e50845f6f35430b7582322ef0b Mon Sep 17 00:00:00 2001 From: Jeff Sheets Date: Sat, 26 Nov 2016 14:50:20 -0600 Subject: Open Document writer: set first level of blockquotes to not use indent (#2757) * Open Document writer: set first level of blockquotes to not use indent Nested blockquotes start using indents like before. Quotation style is still in use, so the style's indent settings take effect on the first level of blockquotes. * Removed list construction to improve pull request to fix #2747 --- src/Text/Pandoc/Writers/OpenDocument.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 8bd0f469e..2395d5fbf 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -107,7 +107,7 @@ increaseIndent :: State WriterState () increaseIndent = modify $ \s -> s { stIndentPara = 1 + stIndentPara s } resetIndent :: State WriterState () -resetIndent = modify $ \s -> s { stIndentPara = (stIndentPara s) - 1 } +resetIndent = modify $ \s -> s { stIndentPara = max (stIndentPara s - 1) 0 } inTightList :: State WriterState a -> State WriterState a inTightList f = modify (\s -> s { stTight = True }) >> f >>= \r -> @@ -315,8 +315,7 @@ blockToOpenDocument o bs setInDefinitionList False return r preformatted s = (flush . vcat) <$> mapM (inPreformattedTags . escapeStringForXML) (lines s) - mkBlockQuote b = do increaseIndent - i <- paraStyle "Quotations" [] + mkBlockQuote b = do i <- paraStyle "Quotations" [] inBlockQuote o i (map plainToPara b) orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a inTags True "text:list" [ ("text:style-name", "L" ++ show ln)] -- cgit v1.2.3