mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
#248 - 11
This commit is contained in:
parent
324b2d6e6f
commit
4b793a1aed
2 changed files with 12 additions and 2 deletions
|
|
@ -591,3 +591,13 @@ a
|
||||||
//- - - - - - - - -//
|
//- - - - - - - - -//
|
||||||
<p>\v</p>
|
<p>\v</p>
|
||||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||||
|
|
||||||
|
|
||||||
|
47: Escape back slashes should not be treated as hard line breaks
|
||||||
|
//- - - - - - - - -//
|
||||||
|
\\\\
|
||||||
|
a
|
||||||
|
//- - - - - - - - -//
|
||||||
|
<p>\
|
||||||
|
a</p>
|
||||||
|
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||||
|
|
|
||||||
|
|
@ -1132,11 +1132,11 @@ func (p *parser) parseBlock(block text.BlockReader, parent ast.Node, pc Context)
|
||||||
softLinebreak := false
|
softLinebreak := false
|
||||||
hardlineBreak := false
|
hardlineBreak := false
|
||||||
hasNewLine := line[lineLength-1] == '\n'
|
hasNewLine := line[lineLength-1] == '\n'
|
||||||
if lineLength >= 2 && line[lineLength-2] == '\\' && hasNewLine { // ends with \\n
|
if ((lineLength >= 3 && line[lineLength-2] == '\\' && line[lineLength-3] != '\\') || (lineLength == 2 && line[lineLength-2] == '\\')) && hasNewLine { // ends with \\n
|
||||||
lineLength -= 2
|
lineLength -= 2
|
||||||
hardlineBreak = true
|
hardlineBreak = true
|
||||||
|
|
||||||
} else if lineLength >= 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && hasNewLine { // ends with \\r\n
|
} else if ((lineLength >= 4 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r' && line[lineLength-4] != '\\') || (lineLength == 3 && line[lineLength-3] == '\\' && line[lineLength-2] == '\r')) && hasNewLine { // ends with \\r\n
|
||||||
lineLength -= 3
|
lineLength -= 3
|
||||||
hardlineBreak = true
|
hardlineBreak = true
|
||||||
} else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && hasNewLine { // ends with [space][space]\n
|
} else if lineLength >= 3 && line[lineLength-3] == ' ' && line[lineLength-2] == ' ' && hasNewLine { // ends with [space][space]\n
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue