diff options
author | Jeff Sheets <jjsheets@users.noreply.github.com> | 2016-11-26 14:50:20 -0600 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-26 21:50:20 +0100 |
commit | fee0b913c5dd95e50845f6f35430b7582322ef0b (patch) | |
tree | 2708d0e92fd764440691fe2935025b42ddccc643 | |
parent | 5219599a775b5765d39ddceae4d57223c8eacc41 (diff) | |
download | pandoc-fee0b913c5dd95e50845f6f35430b7582322ef0b.tar.gz |
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
-rw-r--r-- | src/Text/Pandoc/Writers/OpenDocument.hs | 5 |
1 files 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)] |