Thanks for quick fix for last report!
This is a minor issue when input strings end with a single newline character, adding a further newline character works as a fix.
I'd half expect no newline character to still catch the final paragraph as well, I'm not sure.
Thanks again, Rohan
What steps will reproduce the problem?
test.hs >>> import Text.Pandoc.Readers.Markdown ( readMarkdown ) import Text.Pandoc.Writers.HTML ( writeHtmlString ) import Text.Pandoc.Definition import Text.Pandoc.Shared
prs = defaultParserState { stateParseRaw = False , stateTabStop = 4 , stateStandalone = False , stateSmart = False , stateColumns = 1 , stateStrict = True , stateInlineLinks = False }
opt = WriterOptions { writerStandalone = False , writerTitlePrefix = "" , writerHeader = "" , writerIncludeBefore = "" , writerIncludeAfter = "" , writerS5 = False , writerIncremental = False , writerNumberSections = False , writerStrictMarkdown = True , writerTabStop = 4 , writerNotes = [] }
main = do let s = "this is a paragraph\n\nand this is another\n" d = readMarkdown prs s putStrLn (writeHtmlString opt d) <<<
What is the expected output? What do you see instead?
expect:
<p >this is a paragraph</p ><p >and this is another</p >
receive:
<p >this is a paragraph</p >and this is another
What version of the product are you using? On what operating system?
Current svn (as of 12/3/07)
$ pandoc --version pandoc 0.4 Copyright (C) 2006 John MacFarlane Web: http://sophos.berkeley.edu/macfarlane/pandoc This is free software; see the source for copying conditions. There is no warranty, not even for merchantability or fitness for a particular purpose. $ uname --all Linux alice.localdomain 2.6.20-rt8 #1 PREEMPT Thu Mar 8 23:01:25 EST 2007 i686 i686 i386 GNU/Linux $
Please provide any additional information below.
Comment #1
Posted on Apr 22, 2007 by Grumpy DogYes, I agree. readMarkdown should behave like the pandoc executable, treating text at the end of a file as if it has blank space after it.
This has been fixed in r588.
Status: Fixed
Labels:
Type-Defect
Priority-Medium