Permalink
Browse files

preformat: one \n is not enough. Fix parsing of input containing \r\n…

… line endings.
  • Loading branch information...
knieriem committed Apr 29, 2012
1 parent f721084 commit 4cfb83f5d7eeee5727eb6310cd9d4fef1b02b613
Showing with 2 additions and 2 deletions.
  1. +2 −2 markdown.go
View
@@ -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()
}

0 comments on commit 4cfb83f

Please sign in to comment.