Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(parser/render): Multiple roles for images. #669

Merged
merged 1 commit into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions pkg/parser/paragraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,17 +638,15 @@ I am a verse paragraph.`
image::foo.png[]`
expected := types.DraftDocument{
Blocks: []interface{}{
types.Paragraph{
types.ImageBlock{
Attributes: types.Attributes{
types.AttrKind: types.Verse,
types.AttrQuoteAuthor: "john doe",
types.AttrQuoteTitle: "verse title",
types.AttrImageAlt: "verse",
types.AttrImageWidth: "john doe",
types.AttrImageHeight: "verse title",
},
Lines: [][]interface{}{
{
types.StringElement{
Content: "image::foo.png[]",
},
Location: types.Location{
Path: []interface{}{
types.StringElement{Content: "foo.png"},
},
},
},
Expand Down Expand Up @@ -842,19 +840,14 @@ image::foo.png[]`
expected := types.DraftDocument{
Blocks: []interface{}{
types.ImageBlock{
Attributes: types.Attributes{

// quote attributes
types.AttrKind: types.Quote,
types.AttrQuoteAuthor: "john doe",
types.AttrQuoteTitle: "quote title",
},
Location: types.Location{
Path: []interface{}{
types.StringElement{
Content: "foo.png",
},
},
Scheme: "",
Path: []interface{}{types.StringElement{Content: "foo.png"}},
},
Attributes: types.Attributes{
types.AttrImageAlt: "quote",
types.AttrImageWidth: "john doe",
types.AttrImageHeight: "quote title",
},
},
},
Expand Down
Loading