mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fixes gohugoio/hugo#6549
This commit is contained in:
parent
54fc7c3f18
commit
8549b83b0c
2 changed files with 16 additions and 4 deletions
|
|
@ -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>
|
||||||
|
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue