Resolved issue #10: instead of adding "\n\n" to the
end of strings in Main, do it in readMarkdown and readRST.
(Note: the point of this is to ensure that a block at the
end of the file gets treated as if it has blank space after
it, which is generally what is wanted.)
git-svn-id: https://pandoc.googlecode.com/svn/trunk@588 788f1e2b-df1e-0410-8736-df70ead52e1b
commit485fa81559749f564a56c8b9638c4d03921ba9dd
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
dateSun 22 Apr 2007, 04:38 (20 years ago)
parent726685a
src/Main.hs+1−1
@@ -444,7 +444,7 @@ main = do
444444 Nothing -> stateColumns defaultParserState
445445
446446 let tabFilter = if preserveTabs then id else (tabsToSpaces tabStop)
447− let addBlank str = str ++ "\n\n"
447+ let addBlank str = str
448448 let removeCRs str = filter (/= '\r') str -- remove DOS-style line endings
449449 let filter = tabFilter . addBlank . removeCRs
450450 let startParserState =
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -47,7 +47,7 @@ import Text.ParserCombinators.Parsec
4747
4848-- | Read markdown from an input string and return a Pandoc document.
4949readMarkdown :: ParserState -> String -> Pandoc
50−readMarkdown = readWith parseMarkdown
50+readMarkdown state str = (readWith parseMarkdown) state (str ++ "\n\n")
5151
5252-- | Parse markdown string with default options and print result (for testing).
5353testString :: String -> IO ()
src/Text/Pandoc/Readers/RST.hs+1−1
@@ -42,7 +42,7 @@ import Data.Char ( toUpper )
4242
4343-- | Parse reStructuredText string and return Pandoc document.
4444readRST :: ParserState -> String -> Pandoc
45−readRST = readWith parseRST
45+readRST state str = (readWith parseRST) state (str ++ "\n\n")
4646
4747-- | Parse a string and print result (for testing).
4848testString :: String -> IO ()