Skip to content

Commit

Permalink
fix(parser): links with line breaks in attributes (bytesparadise#858)
Browse files Browse the repository at this point in the history
Fixes bytesparadise#850

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Nov 20, 2021
1 parent 0d6d40c commit 7801194
Show file tree
Hide file tree
Showing 4 changed files with 11,849 additions and 11,812 deletions.
26 changes: 26 additions & 0 deletions pkg/parser/link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,32 @@ a link to {scheme}:{path}[] and https://foo.com`
Expect(ParseDocument(source)).To(MatchDocument(expected))
})

It("links with line breaks in attributes", func() {
source := `link:x[
title]`
expected := &types.Document{
Elements: []interface{}{
&types.Paragraph{
Elements: []interface{}{
&types.InlineLink{
Attributes: types.Attributes{
types.AttrInlineLinkText: "title",
},
Location: &types.Location{
Path: []interface{}{
&types.StringElement{
Content: "x",
},
},
},
},
},
},
},
}
Expect(ParseDocument(source)).To(MatchDocument(expected))
})

Context("text attribute with comma", func() {

It("relative link only with text having comma", func() {
Expand Down
Loading

0 comments on commit 7801194

Please sign in to comment.