git.iko.soy/typeable/pandoc
on master help sign in
Moved stateColumns to readerColumns in ReaderOptions.
0d4424cJohn MacFarlane
src/Text/Pandoc/Options.hs+2
@@ -55,6 +55,7 @@ data ReaderOptions = ReaderOptions{
55 , readerSmart :: Bool -- ^ Smart punctuation
55 , readerSmart :: Bool -- ^ Smart punctuation
56 , readerStrict :: Bool -- ^ FOR TRANSITION ONLY
56 , readerStrict :: Bool -- ^ FOR TRANSITION ONLY
57 , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
57 , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
58+ , readerColumns :: Int -- ^ Number of columns in terminal
58 } deriving (Show, Read)
59 } deriving (Show, Read)
59
60
60instance Default ReaderOptions
61instance Default ReaderOptions
@@ -63,4 +64,5 @@ instance Default ReaderOptions
63 , readerSmart = False
64 , readerSmart = False
64 , readerStrict = False
65 , readerStrict = False
65 , readerParseRaw = False
66 , readerParseRaw = False
67+ , readerColumns = 80
66 }
68 }
src/Text/Pandoc/Parsing.hs+1−3
@@ -545,7 +545,7 @@ tableWith headerParser rowParser lineParser footerParser = try $ do
545 lines' <- rowParser indices `sepEndBy1` lineParser
545 lines' <- rowParser indices `sepEndBy1` lineParser
546 footerParser
546 footerParser
547 state <- getState
547 state <- getState
548− let numColumns = stateColumns state
548+ numColumns <- getOption readerColumns
549 let widths = if (indices == [])
549 let widths = if (indices == [])
550 then replicate (length aligns) 0.0
550 then replicate (length aligns) 0.0
551 else widthsFromIndices numColumns indices
551 else widthsFromIndices numColumns indices
@@ -705,7 +705,6 @@ data ParserState = ParserState
705 -- in parsing dashes; -- is em-dash;
705 -- in parsing dashes; -- is em-dash;
706 -- before numeral is en-dash
706 -- before numeral is en-dash
707 stateLiterateHaskell :: Bool, -- ^ Treat input as literate haskell
707 stateLiterateHaskell :: Bool, -- ^ Treat input as literate haskell
708− stateColumns :: Int, -- ^ Number of columns in terminal
709 stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
708 stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
710 stateIndentedCodeClasses :: [String], -- ^ Classes to use for indented code blocks
709 stateIndentedCodeClasses :: [String], -- ^ Classes to use for indented code blocks
711 stateNextExample :: Int, -- ^ Number of next example
710 stateNextExample :: Int, -- ^ Number of next example
@@ -737,7 +736,6 @@ defaultParserState =
737 stateDate = [],
736 stateDate = [],
738 stateOldDashes = False,
737 stateOldDashes = False,
739 stateLiterateHaskell = False,
738 stateLiterateHaskell = False,
740− stateColumns = 80,
741 stateHeaderTable = [],
739 stateHeaderTable = [],
742 stateIndentedCodeClasses = [],
740 stateIndentedCodeClasses = [],
743 stateNextExample = 1,
741 stateNextExample = 1,
src/pandoc.hs+1−1
@@ -942,12 +942,12 @@ main = do
942 stateStandalone = standalone',
942 stateStandalone = standalone',
943 stateCitations = map CSL.refId refs,
943 stateCitations = map CSL.refId refs,
944 stateOldDashes = oldDashes,
944 stateOldDashes = oldDashes,
945− stateColumns = columns,
946 stateOptions = def{
945 stateOptions = def{
947 readerStrict = strict
946 readerStrict = strict
948 , readerSmart = smart || (texLigatures &&
947 , readerSmart = smart || (texLigatures &&
949 (laTeXOutput || writerName' == "context"))
948 (laTeXOutput || writerName' == "context"))
950 , readerParseRaw = parseRaw
949 , readerParseRaw = parseRaw
950+ , readerColumns = columns
951 },
951 },
952 stateIndentedCodeClasses = codeBlockClasses,
952 stateIndentedCodeClasses = codeBlockClasses,
953 stateApplyMacros = not laTeXOutput
953 stateApplyMacros = not laTeXOutput