Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add color setting to control when colors are applied
- Loading branch information
1 parent
af78238
commit 501e3b3
Showing
6 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe TTY::Markdown, "color" do | ||
it "switches off coloring for all elements" do | ||
markdown =<<-TEXT | ||
# Header | ||
**bold** | ||
``` | ||
class Greeter | ||
def say | ||
end | ||
end | ||
``` | ||
TEXT | ||
parsed = TTY::Markdown.parse(markdown, color: :never) | ||
|
||
expect(parsed).to eq([ | ||
"Header", | ||
"", | ||
"bold", | ||
"", | ||
"class Greeter", | ||
" def say", | ||
" end", | ||
"end" | ||
].join("\n")) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters