From 4cfb83f5d7eeee5727eb6310cd9d4fef1b02b613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Teichgr=C3=A4ber?= Date: Sun, 29 Apr 2012 23:47:53 +0200 Subject: [PATCH] preformat: one \n is not enough. Fix parsing of input containing \r\n line endings. --- markdown.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown.go b/markdown.go index 038f9c4..094b2e4 100644 --- a/markdown.go +++ b/markdown.go @@ -73,7 +73,7 @@ L: tree = p.processRawBlocks(tree) f.FormatBlock(tree) switch s { - case "", "\n", "\n\n": + case "", "\n", "\r\n", "\n\n", "\r\n\n", "\n\n\n", "\r\n\n\n": break L } } @@ -169,6 +169,6 @@ func (p *Parser) preformat(r io.Reader) (s string) { b.Write(buf[i0:n]) } - b.WriteString("\n") + b.WriteString("\n\n") return b.String() }