This commit is contained in:
yuin 2019-11-29 17:21:05 +09:00
parent 54fc7c3f18
commit 8549b83b0c
2 changed files with 16 additions and 4 deletions

View file

@ -8,3 +8,15 @@
B</li> B</li>
</ul> </ul>
//= = = = = = = = = = = = = = = = = = = = = = = =// //= = = = = = = = = = = = = = = = = = = = = = = =//
2
//- - - - - - - - -//
**test**\
test**test**\
**test**test\
test**test**
//- - - - - - - - -//
<p><strong>test</strong><br />
test<strong>test</strong><br />
<strong>test</strong>test<br />
test<strong>test</strong></p>
//= = = = = = = = = = = = = = = = = = = = = = = =//

View file

@ -1088,17 +1088,17 @@ func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context)
lineLength := len(line) lineLength := len(line)
hardlineBreak := false hardlineBreak := false
softLinebreak := line[lineLength-1] == '\n' softLinebreak := line[lineLength-1] == '\n'
if lineLength > 2 && line[lineLength-2] == '\\' && softLinebreak { // ends with \\n if lineLength >= 2 && line[lineLength-2] == '\\' && softLinebreak { // ends with \\n
lineLength -= 2 lineLength -= 2
hardlineBreak = true hardlineBreak = true
} else if lineLength > 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && softLinebreak { // ends with \\r\n } else if lineLength >= 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && softLinebreak { // ends with \\r\n
lineLength -= 3 lineLength -= 3
hardlineBreak = true hardlineBreak = true
} else if lineLength > 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && softLinebreak { // ends with [space][space]\n } else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && softLinebreak { // ends with [space][space]\n
lineLength -= 3 lineLength -= 3
hardlineBreak = true hardlineBreak = true
} else if lineLength > 4 && line[lineLength-4] == ' ' && line[lineLength-3] == ' ' && line[lineLength-2] == '\r' && softLinebreak { // ends with [space][space]\r\n } else if lineLength >= 4 && line[lineLength-4] == ' ' && line[lineLength-3] == ' ' && line[lineLength-2] == '\r' && softLinebreak { // ends with [space][space]\r\n
lineLength -= 4 lineLength -= 4
hardlineBreak = true hardlineBreak = true
} }