Merge pull request #107 from shurcooL/master

Improve parser to detect LineBreak independently of renderer.
pull/111/head
Vytautas Šaltenis 2014-08-27 10:28:42 +03:00
commit 7dd925f93d
1 changed files with 3 additions and 1 deletions

View File

@ -166,8 +166,10 @@ func lineBreak(p *parser, out *bytes.Buffer, data []byte, offset int) int {
}
out.Truncate(eol)
precededByTwoSpaces := offset >= 2 && data[offset-2] == ' ' && data[offset-1] == ' '
// should there be a hard line break here?
if p.flags&EXTENSION_HARD_LINE_BREAK == 0 && end-eol < 2 {
if p.flags&EXTENSION_HARD_LINE_BREAK == 0 && !precededByTwoSpaces {
return 0
}