diff --git a/pkg/parser/link_test.go b/pkg/parser/link_test.go index 58ef0875..da759e54 100644 --- a/pkg/parser/link_test.go +++ b/pkg/parser/link_test.go @@ -1310,6 +1310,46 @@ a link to {scheme}:{path}[] and https://foo.com` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("links with underscores", func() { + source := "link:a_[A] link:a_[A]" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "a_", + }, + }, + }, + }, + &types.StringElement{ + Content: " ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "a_", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + Context("text attribute with comma", func() { It("relative link only with text having comma", func() { diff --git a/pkg/renderer/sgml/html5/link_test.go b/pkg/renderer/sgml/html5/link_test.go index 81a1dba2..a682cef5 100644 --- a/pkg/renderer/sgml/html5/link_test.go +++ b/pkg/renderer/sgml/html5/link_test.go @@ -328,6 +328,15 @@ a link to {scheme}:{path}[] and https://foo.baz` expected := `
a link to {path} and https://foo.baz