This commit is contained in:
yuin 2021-09-11 12:25:17 +09:00
parent 4317d98509
commit 457c157ed5
2 changed files with 30 additions and 2 deletions

View file

@ -425,3 +425,25 @@ x
<p>x
*</p>
//= = = = = = = = = = = = = = = = = = = = = = = =//
30: A link reference definition followed by a single quote without closer
//- - - - - - - - -//
[x]
[x]: <>
'
//- - - - - - - - -//
<p><a href="">x</a></p>
<p>'</p>
//= = = = = = = = = = = = = = = = = = = = = = = =//
31: A link reference definition followed by a double quote without closer
//- - - - - - - - -//
[x]
[x]: <>
"
//- - - - - - - - -//
<p><a href="">x</a></p>
<p>&quot;</p>
//= = = = = = = = = = = = = = = = = = = = = = = =//

View file

@ -126,7 +126,7 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) {
for {
line, segment = block.PeekLine()
if line == nil {
return -1, -1
break
}
if open < 0 {
open = segment.Start
@ -139,8 +139,14 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) {
}
block.AdvanceLine()
}
if closes < 0 {
return -1, -1
if !isNewLine {
return -1, -1
}
ref := NewReference(label, destination, nil)
pc.AddReference(ref)
return startLine, endLine
}
line, segment = block.PeekLine()