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
This commit is contained in:
Jeff Sheets 2016-11-26 14:50:20 -06:00 committed by John MacFarlane
parent 5219599a77
commit fee0b913c5

View file

@ -107,7 +107,7 @@ increaseIndent :: State WriterState ()
increaseIndent = modify $ \s -> s { stIndentPara = 1 + stIndentPara s } increaseIndent = modify $ \s -> s { stIndentPara = 1 + stIndentPara s }
resetIndent :: State WriterState () 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 :: State WriterState a -> State WriterState a
inTightList f = modify (\s -> s { stTight = True }) >> f >>= \r -> inTightList f = modify (\s -> s { stTight = True }) >> f >>= \r ->
@ -315,8 +315,7 @@ blockToOpenDocument o bs
setInDefinitionList False setInDefinitionList False
return r return r
preformatted s = (flush . vcat) <$> mapM (inPreformattedTags . escapeStringForXML) (lines s) preformatted s = (flush . vcat) <$> mapM (inPreformattedTags . escapeStringForXML) (lines s)
mkBlockQuote b = do increaseIndent mkBlockQuote b = do i <- paraStyle "Quotations" []
i <- paraStyle "Quotations" []
inBlockQuote o i (map plainToPara b) inBlockQuote o i (map plainToPara b)
orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a
inTags True "text:list" [ ("text:style-name", "L" ++ show ln)] inTags True "text:list" [ ("text:style-name", "L" ++ show ln)]