aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-07-25 22:04:23 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-07-25 22:05:06 -0700
commit9b5d2031c7d643de3397da2e4f38b2f6b45feb64 (patch)
tree32fa78753fa540da081d45f5c1c62f26ef42f3f0 /src
parent2654da38237a981777ed57e4af64781e3773bf01 (diff)
downloadpandoc-9b5d2031c7d643de3397da2e4f38b2f6b45feb64.tar.gz
Restored stateStandalone as readerStandalone.
It is indeed needed by the RST reader.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Options.hs2
-rw-r--r--src/Text/Pandoc/Readers/RST.hs7
-rw-r--r--src/pandoc.hs1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index aef18e7eb..189adfa24 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -54,6 +54,7 @@ data ReaderOptions = ReaderOptions{
readerExtensions :: Set Extension -- ^ Syntax extensions
, readerSmart :: Bool -- ^ Smart punctuation
, readerStrict :: Bool -- ^ FOR TRANSITION ONLY
+ , readerStandalone :: Bool -- ^ Standalone document with header
, readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
, readerColumns :: Int -- ^ Number of columns in terminal
, readerTabStop :: Int -- ^ Tab stop
@@ -72,6 +73,7 @@ instance Default ReaderOptions
readerExtensions = Set.fromList [minBound..maxBound]
, readerSmart = False
, readerStrict = False
+ , readerStandalone = False
, readerParseRaw = False
, readerColumns = 80
, readerTabStop = 4
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 39da6de6a..11bcb7f0e 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -103,10 +103,13 @@ parseRST = do
let reversedNotes = stateNotes st'
updateState $ \s -> s { stateNotes = reverse reversedNotes }
-- now parse it for real...
- blocks <- parseBlocks
+ blocks <- parseBlocks
let blocks' = filter (/= Null) blocks
+ standalone <- getOption readerStandalone
+ let (blocks'', title) = if standalone
+ then titleTransform blocks'
+ else (blocks', [])
state <- getState
- let (blocks'', title) = titleTransform blocks'
let authors = stateAuthors state
let date = stateDate state
let title' = if (null title) then (stateTitle state) else title
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 725f13e09..72b13beb8 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -940,6 +940,7 @@ main = do
readerStrict = strict
, readerSmart = smart || (texLigatures &&
(laTeXOutput || writerName' == "context"))
+ , readerStandalone = standalone'
, readerParseRaw = parseRaw
, readerColumns = columns
, readerTabStop = tabStop