tty-markdown 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/tty/markdown/parser.rb +12 -2
- data/lib/tty/markdown/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df1fbc99e38c58ae4440884d583608273328d2a1
|
4
|
+
data.tar.gz: 891c8f4e64b506b07431d93eba3338431cb9d0bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac16bc20d726d43d891cf8b60158ed1a08fe721553ba65b3ded16e4e564018899644fde56f59fb72b9d568d755813768cab380edf35716a227cc2dd05251516
|
7
|
+
data.tar.gz: 26eed0a5bcf7c4ceab71faf76b2aa75814d950d7c8776bc5d1dc61b3982b014730904e5913b30705be4423f09abe98baca71d0dd072abc1c1ca1735e2cfe420e
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.4.0] - 2018-06-20
|
4
|
+
|
5
|
+
## Fixed
|
6
|
+
* Fix multiline paragraph indentation by Brett(@suwyn)
|
7
|
+
|
3
8
|
## [v0.3.0] - 2018-03-17
|
4
9
|
|
5
10
|
### Added
|
@@ -32,6 +37,7 @@
|
|
32
37
|
|
33
38
|
* Initial implementation and release
|
34
39
|
|
40
|
+
[v0.4.0]: https://github.com/piotrmurach/tty-markdown/compare/v0.3.0...v0.4.0
|
35
41
|
[v0.3.0]: https://github.com/piotrmurach/tty-markdown/compare/v0.2.0...v0.3.0
|
36
42
|
[v0.2.0]: https://github.com/piotrmurach/tty-markdown/compare/v0.1.0...v0.2.0
|
37
43
|
[v0.1.0]: https://github.com/piotrmurach/tty-markdown/compare/v0.1.0
|
data/README.md
CHANGED
data/lib/tty/markdown/parser.rb
CHANGED
@@ -69,6 +69,9 @@ module TTY
|
|
69
69
|
opts[:result] << indent
|
70
70
|
end
|
71
71
|
|
72
|
+
opts[:indent] = @current_indent
|
73
|
+
opts[:strip] = false
|
74
|
+
|
72
75
|
case opts[:parent].type
|
73
76
|
when :li
|
74
77
|
bullet = TTY::Markdown.symbols[:bullet]
|
@@ -76,6 +79,10 @@ module TTY
|
|
76
79
|
symbol = opts[:ordered] ? "#{index}." : bullet
|
77
80
|
styles = Array(@theme[:list])
|
78
81
|
opts[:result] << @pastel.decorate(symbol, *styles) + ' '
|
82
|
+
opts[:indent] += @indent
|
83
|
+
opts[:strip] = true
|
84
|
+
when :blockquote
|
85
|
+
opts[:indent] = 0
|
79
86
|
end
|
80
87
|
|
81
88
|
inner(el, opts)
|
@@ -127,8 +134,11 @@ module TTY
|
|
127
134
|
end
|
128
135
|
|
129
136
|
def convert_text(el, opts)
|
130
|
-
text = el.value
|
131
|
-
opts[:
|
137
|
+
text = Strings.wrap(el.value, @width)
|
138
|
+
text.strip! if opts[:strip]
|
139
|
+
indent = ' ' * opts[:indent]
|
140
|
+
text = text.gsub(/\n/, "\n#{indent}")
|
141
|
+
opts[:result] << text
|
132
142
|
end
|
133
143
|
|
134
144
|
def convert_strong(el, opts)
|
data/lib/tty/markdown/version.rb
CHANGED
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|