demydd / pandoc

Automatically exported from code.google.com/p/pandoc
0 stars 0 forks source link

missing final paragraph annotation #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by rohan.dr...@gmail.com on 12 Mar 2007 at 10:36

GoogleCodeExporter commented 8 years ago
Yes, 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.

Original comment by fiddloso...@gmail.com on 22 Apr 2007 at 4:39