git.iko.soy/typeable/pandoc
on master help sign in
Moved stateColumns to readerColumns in ReaderOptions.
commit0d4424c21c7d3d6da068a77750db72f61ff0e0cd authorJohn MacFarlane <fiddlosopher@gmail.com> dateWed 25 Jul 2012, 11:51 (14 years ago) parentef0619c
3 files changed+4−4
src/Text/Pandoc/Options.hs+2 src/Text/Pandoc/Parsing.hs+1−3 src/pandoc.hs+1−1
src/Text/Pandoc/Options.hs+2
@@ -55,6 +55,7 @@ data ReaderOptions = ReaderOptions{
5555 , readerSmart :: Bool -- ^ Smart punctuation
5656 , readerStrict :: Bool -- ^ FOR TRANSITION ONLY
5757 , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
58+ , readerColumns :: Int -- ^ Number of columns in terminal
5859 } deriving (Show, Read)
5960
6061instance Default ReaderOptions
@@ -63,4 +64,5 @@ instance Default ReaderOptions
6364 , readerSmart = False
6465 , readerStrict = False
6566 , readerParseRaw = False
67+ , readerColumns = 80
6668 }
src/Text/Pandoc/Parsing.hs+1−3
@@ -545,7 +545,7 @@ tableWith headerParser rowParser lineParser footerParser = try $ do
545545 lines' <- rowParser indices `sepEndBy1` lineParser
546546 footerParser
547547 state <- getState
548− let numColumns = stateColumns state
548+ numColumns <- getOption readerColumns
549549 let widths = if (indices == [])
550550 then replicate (length aligns) 0.0
551551 else widthsFromIndices numColumns indices
@@ -705,7 +705,6 @@ data ParserState = ParserState
705705 -- in parsing dashes; -- is em-dash;
706706 -- before numeral is en-dash
707707 stateLiterateHaskell :: Bool, -- ^ Treat input as literate haskell
708− stateColumns :: Int, -- ^ Number of columns in terminal
709708 stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
710709 stateIndentedCodeClasses :: [String], -- ^ Classes to use for indented code blocks
711710 stateNextExample :: Int, -- ^ Number of next example
@@ -737,7 +736,6 @@ defaultParserState =
737736 stateDate = [],
738737 stateOldDashes = False,
739738 stateLiterateHaskell = False,
740− stateColumns = 80,
741739 stateHeaderTable = [],
742740 stateIndentedCodeClasses = [],
743741 stateNextExample = 1,
src/pandoc.hs+1−1
@@ -942,12 +942,12 @@ main = do
942942 stateStandalone = standalone',
943943 stateCitations = map CSL.refId refs,
944944 stateOldDashes = oldDashes,
945− stateColumns = columns,
946945 stateOptions = def{
947946 readerStrict = strict
948947 , readerSmart = smart || (texLigatures &&
949948 (laTeXOutput || writerName' == "context"))
950949 , readerParseRaw = parseRaw
950+ , readerColumns = columns
951951 },
952952 stateIndentedCodeClasses = codeBlockClasses,
953953 stateApplyMacros = not laTeXOutput