Skip to content

Commit

Permalink
fix(parser): support newlines in link attributes (#1096)
Browse files Browse the repository at this point in the history
Fixes #1095

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Oct 7, 2022
1 parent 886f3d9 commit f537bdf
Show file tree
Hide file tree
Showing 4 changed files with 4,371 additions and 4,294 deletions.
27 changes: 27 additions & 0 deletions pkg/parser/link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,33 @@ a link to <{example}>.`
Expect(ParseDocument(source)).To(MatchDocument(expected))
})

It("with text with newline", func() {
source := `a link to mailto:[email protected][the
email].`
expected := &types.Document{
Elements: []interface{}{
&types.Paragraph{
Elements: []interface{}{
&types.StringElement{Content: "a link to "},
&types.InlineLink{
Location: &types.Location{
Scheme: "mailto:",
Path: "[email protected]",
},
Attributes: types.Attributes{
types.AttrInlineLinkText: "the\nemail",
},
},
&types.StringElement{
Content: ".",
},
},
},
},
}
Expect(ParseDocument(source)).To(MatchDocument(expected))
})

It("with text and extra attributes", func() {
source := "a link to mailto:[email protected][the [email protected] email, foo=fighters]"
expected := &types.Document{
Expand Down
Loading

0 comments on commit f537bdf

Please sign in to comment.