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

refactor(types): use Kind field for quoted text kind #277

Merged
merged 1 commit into from
Jan 20, 2019
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
24 changes: 7 additions & 17 deletions pkg/parser/delimited_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,7 @@ with *bold content*
Content: "with ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "bold content",
Expand Down Expand Up @@ -691,9 +689,7 @@ ____`
Content: "some ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "quote",
Expand Down Expand Up @@ -1055,9 +1051,7 @@ ____`
Content: "some ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "verse",
Expand Down Expand Up @@ -1340,7 +1334,7 @@ end
----`
expectedResult := types.DelimitedBlock{
Attributes: types.ElementAttributes{
types.AttrKind: types.Source,
types.AttrKind: types.Source,
types.AttrLanguage: "ruby",
},
Kind: types.Source,
Expand Down Expand Up @@ -1389,7 +1383,7 @@ end
----`
expectedResult := types.DelimitedBlock{
Attributes: types.ElementAttributes{
types.AttrKind: types.Source,
types.AttrKind: types.Source,
types.AttrLanguage: "ruby",
types.AttrID: "id-for-source-block",
types.AttrTitle: "app.rb",
Expand Down Expand Up @@ -1446,9 +1440,7 @@ some *verse* content
Content: "some ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "verse",
Expand Down Expand Up @@ -1489,9 +1481,7 @@ bar
Content: "some ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "verse",
Expand Down
4 changes: 1 addition & 3 deletions pkg/parser/document_attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,7 @@ a paragraph with *bold content*`
{
types.StringElement{Content: "a paragraph with "},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "bold content"},
},
Expand Down
4 changes: 1 addition & 3 deletions pkg/parser/footnote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ var _ = Describe("footnotes", func() {
Content: "some ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "rich",
Expand Down
12 changes: 3 additions & 9 deletions pkg/parser/inline_elements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ var _ = Describe("inline elements", func() {
actualContent := "*some bold content*"
expectedResult := types.InlineElements{
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "some bold content"},
},
Expand All @@ -29,9 +27,7 @@ var _ = Describe("inline elements", func() {
expectedResult := types.InlineElements{
types.StringElement{Content: "("},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "some bold content"},
},
Expand Down Expand Up @@ -62,9 +58,7 @@ var _ = Describe("inline elements", func() {
actualContent := "**foo**bar"
expectedResult := types.InlineElements{
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "foo"},
},
Expand Down
12 changes: 3 additions & 9 deletions pkg/parser/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1502,9 +1502,7 @@ another fenced block
{
types.StringElement{Content: "a second item with "},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "bold content"},
},
Expand Down Expand Up @@ -1716,9 +1714,7 @@ another fenced block
{
types.StringElement{Content: "a second item with "},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "bold content"},
},
Expand Down Expand Up @@ -1878,9 +1874,7 @@ another fenced block
{
types.StringElement{Content: "a second item with "},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "bold content"},
},
Expand Down
8 changes: 2 additions & 6 deletions pkg/parser/paragraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ var _ = Describe("paragraphs", func() {
{
types.StringElement{Content: "a paragraph with "},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{Content: "some bold content"},
},
Expand Down Expand Up @@ -288,9 +286,7 @@ this is a
},
{
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "caution",
Expand Down
8 changes: 2 additions & 6 deletions pkg/parser/passthrough_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,7 @@ var _ = Describe("passthroughs", func() {
Kind: types.PassthroughMacro,
Elements: types.InlineElements{
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "hello",
Expand Down Expand Up @@ -353,9 +351,7 @@ var _ = Describe("passthroughs", func() {
Content: " a ",
},
types.QuotedText{
Attributes: types.ElementAttributes{
types.AttrKind: types.Bold,
},
Kind: types.Bold,
Elements: types.InlineElements{
types.StringElement{
Content: "hello",
Expand Down
Loading