tty-markdown 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/tty/markdown/parser.rb +1 -1
- data/lib/tty/markdown/version.rb +1 -1
- data/spec/unit/parse/list_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 281ea39bffa3d221f073b13f978c2955df2cf7df04a5419b5b99d4be95409f9b
|
4
|
+
data.tar.gz: cb68e3e7791fafa7223f05b1e8b3739726423dbddb50ee2e5b4cfe1b5d914ad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01b88370fce23760bcf10ffa5b41d906a44018bd67545491b02e86bf1ac1ac0bd1479279f085437a0847fad84bc850d0f202f34734421c7d5014c0d2e1ff07f1
|
7
|
+
data.tar.gz: 4a1ccb73bcd8a3d1849ecf2db21c2106517ebd2117db6531e1353594a8f2b8fd1daf47ed4d5b61a133f05914c449f166a698887b346de1c4dc204da23d203884
|
data/CHANGELOG.md
CHANGED
data/lib/tty/markdown/parser.rb
CHANGED
@@ -135,7 +135,7 @@ module TTY
|
|
135
135
|
|
136
136
|
def convert_text(el, opts)
|
137
137
|
text = Strings.wrap(el.value, @width)
|
138
|
-
text.
|
138
|
+
text = text.chomp if opts[:strip]
|
139
139
|
indent = ' ' * opts[:indent]
|
140
140
|
text = text.gsub(/\n/, "\n#{indent}")
|
141
141
|
opts[:result] << text
|
data/lib/tty/markdown/version.rb
CHANGED
@@ -68,6 +68,19 @@ RSpec.describe TTY::Markdown, 'list' do
|
|
68
68
|
].join("\n"))
|
69
69
|
end
|
70
70
|
|
71
|
+
it "displays inline codeblocks in lists correctly" do
|
72
|
+
markdown =<<-TEXT
|
73
|
+
- Version: run `ruby -v` or `ruby --version`.
|
74
|
+
- Help: run `ruby -h` or `ruby --help`.
|
75
|
+
TEXT
|
76
|
+
|
77
|
+
parsed = TTY::Markdown.parse(markdown, colors: 16)
|
78
|
+
expect(parsed).to eq([
|
79
|
+
"#{pastel.yellow(symbols[:bullet])} Version: run \e[33mruby -v\e[0m or \e[33mruby --version\e[0m.",
|
80
|
+
"#{pastel.yellow(symbols[:bullet])} Help: run \e[33mruby -h\e[0m or \e[33mruby --help\e[0m.\n"
|
81
|
+
].join("\n"))
|
82
|
+
end
|
83
|
+
|
71
84
|
it "convert ordered numbered list of nested items" do
|
72
85
|
markdown =<<-TEXT
|
73
86
|
1. Item 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|