Skip to content

Commit

Permalink
feature(parser/render): Multiple roles for images.
Browse files Browse the repository at this point in the history
This also includes bug fixes for parser.  We've tried to
emulate most, but not all, of the quirks found in asciidoctor
with respect to images.
  • Loading branch information
gdamore committed Jun 30, 2020
1 parent b323d2f commit cfd2e92
Show file tree
Hide file tree
Showing 11 changed files with 4,103 additions and 3,605 deletions.
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

0 comments on commit cfd2e92

Please sign in to comment.