termcolorlight 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/termcolorlight.rb +1 -1
- data/lib/termcolorlight/html.rb +3 -0
- data/spec/termcolorlight_html_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efbefa44fb297a66906b5097d51756ca7bce0311
|
4
|
+
data.tar.gz: 951db11115e3010087816a6354fda172bed196f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb98f01ec30d09a8a16da7b70f97804a78e9e9458849235fa9d661c3ea2e59e01a42729a5b2ccb9321d93888bdb70da0f0b0a25d13620c6dfffd65f587a46601
|
7
|
+
data.tar.gz: e81e0db24b35638b6a0b7ebd75e3037029a256877d32cf97231d1e74cfc28a0a57193819eea75cf5961c3a6629a3a55e0aa144e8a54d04e9983e4de42204bc19
|
data/lib/termcolorlight.rb
CHANGED
data/lib/termcolorlight/html.rb
CHANGED
@@ -93,6 +93,9 @@ module TermColorLight
|
|
93
93
|
styles << decoration if decoration
|
94
94
|
buffer.concat("<span style=\"#{styles.join(";")}\">")
|
95
95
|
buffer.concat(parse_for_html(ss, tmp_fg, tmp_bg, tmp_intensity, tmp_reverse, tag))
|
96
|
+
unless parent
|
97
|
+
@@before_fg_color = @@before_bg_color = nil
|
98
|
+
end
|
96
99
|
when ss.scan(/<\/([a-z_]+?)>/i)
|
97
100
|
tag = ss[1].downcase
|
98
101
|
if tag != parent
|
@@ -128,6 +128,11 @@ describe TermColorLight do
|
|
128
128
|
.to eq '<span style="font-weight:bold"><span style="color:lime"><span style="color:#333;background:lime">str</span></span></span>'
|
129
129
|
end
|
130
130
|
end
|
131
|
+
|
132
|
+
it do
|
133
|
+
expect(TermColorLight.to_html("(e.g. `narou <bold><yellow>d</yellow></bold> n4259s', `narou <bold><yellow>fr</yellow></bold> musyoku')"))
|
134
|
+
.to eq '(e.g. `narou <span style="font-weight:bold"><span style="color:yellow">d</span></span> n4259s\', `narou <span style="font-weight:bold"><span style="color:yellow">fr</span></span> musyoku\')'
|
135
|
+
end
|
131
136
|
end
|
132
137
|
|
133
138
|
context "give entities" do
|