git.iko.soy/typeable/pandoc
on master help sign in
Revert export of hasSimpleCells from T.P.Writers.Shared.

This wasn't necessary.

commitfd9d08f9d6ac172b0d827150ec10bd95959a1f51 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 7 Oct 2018, 10:20 (8 years ago) parentbd8a663
1 file changed−18
src/Text/Pandoc/Writers/Shared.hs−18
src/Text/Pandoc/Writers/Shared.hs−18
@@ -41,7 +41,6 @@ module Text.Pandoc.Writers.Shared (
4141 , isDisplayMath
4242 , fixDisplayMath
4343 , unsmartify
44− , hasSimpleCells
4544 , gridTable
4645 , lookupMetaBool
4746 , lookupMetaBlocks
@@ -55,7 +54,6 @@ module Text.Pandoc.Writers.Shared (
5554where
5655import Prelude
5756import Control.Monad (zipWithM)
58−import Data.Monoid (Any (..))
5957import Data.Aeson (FromJSON (..), Result (..), ToJSON (..), Value (Object),
6058 encode, fromJSON)
6159import Data.Char (chr, ord, isAscii, isSpace)
@@ -72,7 +70,6 @@ import Text.Pandoc.Pretty
7270import Text.Pandoc.Shared (stringify)
7371import Text.Pandoc.UTF8 (toStringLazy)
7472import Text.Pandoc.XML (escapeStringForXML)
75−import Text.Pandoc.Walk (query)
7673import Text.Printf (printf)
7774
7875-- | Create JSON value for template from a 'Meta' and an association list
@@ -246,21 +243,6 @@ unsmartify opts ('\8216':xs) = '\'' : unsmartify opts xs
246243unsmartify opts (x:xs) = x : unsmartify opts xs
247244unsmartify _ [] = []
248245
249−-- | True if block is a table that can be represented with
250−-- one line per row.
251−hasSimpleCells :: Block -> Bool
252−hasSimpleCells (Table _caption _aligns _widths headers rows) =
253− all isSimpleCell (concat (headers:rows))
254− where
255− isLineBreak LineBreak = Any True
256− isLineBreak _ = Any False
257− hasLineBreak = getAny . query isLineBreak
258− isSimpleCell [Plain ils] = not (hasLineBreak ils)
259− isSimpleCell [Para ils ] = not (hasLineBreak ils)
260− isSimpleCell [] = True
261− isSimpleCell _ = False
262−hasSimpleCells _ = False
263−
264246gridTable :: Monad m
265247 => WriterOptions
266248 -> (WriterOptions -> [Block] -> m Doc)