git.iko.soy/typeable/pandoc
on master help sign in
Restored stateStandalone as readerStandalone.

It is indeed needed by the RST reader.

commit9b5d2031c7d643de3397da2e4f38b2f6b45feb64 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 25 Jul 2012, 22:04 (14 years ago) parent2654da3
3 files changed+8−2
src/Text/Pandoc/Options.hs+2 src/Text/Pandoc/Readers/RST.hs+5−2 src/pandoc.hs+1
src/Text/Pandoc/Options.hs+2
@@ -54,6 +54,7 @@ data ReaderOptions = ReaderOptions{
5454 readerExtensions :: Set Extension -- ^ Syntax extensions
5555 , readerSmart :: Bool -- ^ Smart punctuation
5656 , readerStrict :: Bool -- ^ FOR TRANSITION ONLY
57+ , readerStandalone :: Bool -- ^ Standalone document with header
5758 , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
5859 , readerColumns :: Int -- ^ Number of columns in terminal
5960 , readerTabStop :: Int -- ^ Tab stop
@@ -72,6 +73,7 @@ instance Default ReaderOptions
7273 readerExtensions = Set.fromList [minBound..maxBound]
7374 , readerSmart = False
7475 , readerStrict = False
76+ , readerStandalone = False
7577 , readerParseRaw = False
7678 , readerColumns = 80
7779 , readerTabStop = 4
src/Text/Pandoc/Readers/RST.hs+5−2
@@ -103,10 +103,13 @@ parseRST = do
103103 let reversedNotes = stateNotes st'
104104 updateState $ \s -> s { stateNotes = reverse reversedNotes }
105105 -- now parse it for real...
106− blocks <- parseBlocks
106+ blocks <- parseBlocks
107107 let blocks' = filter (/= Null) blocks
108+ standalone <- getOption readerStandalone
109+ let (blocks'', title) = if standalone
110+ then titleTransform blocks'
111+ else (blocks', [])
108112 state <- getState
109− let (blocks'', title) = titleTransform blocks'
110113 let authors = stateAuthors state
111114 let date = stateDate state
112115 let title' = if (null title) then (stateTitle state) else title
src/pandoc.hs+1
@@ -940,6 +940,7 @@ main = do
940940 readerStrict = strict
941941 , readerSmart = smart || (texLigatures &&
942942 (laTeXOutput || writerName' == "context"))
943+ , readerStandalone = standalone'
943944 , readerParseRaw = parseRaw
944945 , readerColumns = columns
945946 , readerTabStop = tabStop