Skip to content

Commit

Permalink
feat(parser/renderer): support 'nowrap' option on source blocks
Browse files Browse the repository at this point in the history
Fixes bytesparadise#784

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon committed Oct 29, 2020
1 parent 2aaaac1 commit a59dc16
Show file tree
Hide file tree
Showing 8 changed files with 3,341 additions and 3,241 deletions.
26 changes: 26 additions & 0 deletions pkg/parser/delimited_block_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,32 @@ a note
}
Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected))
})

It("with nowrap option", func() {
source := `[source%nowrap,go]
----
const Cookie = "cookie"
----`
expected := types.DraftDocument{
Elements: []interface{}{
types.ListingBlock{
Attributes: types.Attributes{
types.AttrBlockKind: types.Source,
types.AttrSourceBlockOption: "nowrap",
types.AttrLanguage: "go",
},
Lines: [][]interface{}{
{
types.StringElement{
Content: `const Cookie = "cookie"`,
},
},
},
},
},
}
Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected))
})
})
})

Expand Down
Loading

0 comments on commit a59dc16

Please sign in to comment.