aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDenis Maier <denis.maier@ub.unibe.ch>2021-05-20 18:59:53 +0200
committerGitHub <noreply@github.com>2021-05-20 09:59:53 -0700
commit183ce584779b344ad6a6a3e085ddfdb00faf62aa (patch)
tree7c16b49e3392a87dadc8fa29c1a7222982e3eae8 /src
parenta366bd6abccd18a49f0033de850ddd53830cc5ed (diff)
downloadpandoc-183ce584779b344ad6a6a3e085ddfdb00faf62aa.tar.gz
ConTeXt reader: improve ordered lists (#7304)
Closes #5016 - change ordered list from itemize to enumerate - adds new itemgroup for ordered lists - add fontfeature for table figures - remove width from itemize in context writer
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 57d752a67..3cafcefba 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -16,7 +16,6 @@ module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where
import Control.Monad.State.Strict
import Data.Char (ord, isDigit)
import Data.List (intersperse)
-import Data.List.NonEmpty (nonEmpty)
import Data.Maybe (mapMaybe)
import Data.Text (Text)
import qualified Data.Text as T
@@ -233,14 +232,7 @@ blockToConTeXt (OrderedList (start, style', delim) lst) = do
Period -> "stopper=."
OneParen -> "stopper=)"
TwoParens -> "left=(,stopper=)"
- let width = maybe 0 maximum $ nonEmpty $ map T.length $
- take (length contents)
- (orderedListMarkers (start, style', delim))
- let width' = (toEnum width + 1) / 2
- let width'' = if width' > (1.5 :: Double)
- then "width=" <> tshow width' <> "em"
- else ""
- let specs2Items = filter (not . T.null) [start', delim', width'']
+ let specs2Items = filter (not . T.null) [start', delim']
let specs2 = if null specs2Items
then ""
else "[" <> T.intercalate "," specs2Items <> "]"
@@ -254,8 +246,8 @@ blockToConTeXt (OrderedList (start, style', delim) lst) = do
UpperAlpha -> 'A') :
if isTightList lst then ",packed]" else "]"
let specs = T.pack style'' <> specs2
- return $ "\\startitemize" <> literal specs $$ vcat contents $$
- "\\stopitemize" <> blankline
+ return $ "\\startenumerate" <> literal specs $$ vcat contents $$
+ "\\stopenumerate" <> blankline
blockToConTeXt (DefinitionList lst) =
liftM vcat $ mapM defListItemToConTeXt lst
blockToConTeXt HorizontalRule = return $ "\\thinrule" <> blankline