diff --git a/_test/extra.txt b/_test/extra.txt index b5246d3..a1e2c9a 100644 --- a/_test/extra.txt +++ b/_test/extra.txt @@ -526,3 +526,30 @@ _a[b_c_](d)
<a\f>
< p>
//= = = = = = = = = = = = = = = = = = = = = = = =// + +41: Link references can not contain spaces after link label +//- - - - - - - - -// +[x] +:> + +[o] :x +//- - - - - - - - -// +[x] +:>
+[o] :x
+//= = = = = = = = = = = = = = = = = = = = = = = =// + + +42: Unclosed link reference titles can interrupt link references +//- - - - - - - - -// +[r]: +<> +' + +[o]: +x +' +//- - - - - - - - -// +'
+'
+//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/parser/link_ref.go b/parser/link_ref.go index dd98ed1..ea3f654 100644 --- a/parser/link_ref.go +++ b/parser/link_ref.go @@ -84,7 +84,6 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) { if util.IsBlank(label) { return -1, -1 } - block.SkipSpaces() if block.Peek() != ':' { return -1, -1 } @@ -123,7 +122,8 @@ func parseLinkReferenceDefinition(block text.Reader, pc Context) (int, int) { } ref := NewReference(label, destination, nil) pc.AddReference(ref) - return startLine, endLine + block.AdvanceLine() + return startLine, endLine + 1 } var title []byte if segments.Len() == 1 {