termcolorlight 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac7c7270e7a4af913ceb1bc407d1ab29218a981a
4
- data.tar.gz: ef1686b75a7a44bede28fe31e9445c5b2cb28b48
3
+ metadata.gz: efbefa44fb297a66906b5097d51756ca7bce0311
4
+ data.tar.gz: 951db11115e3010087816a6354fda172bed196f0
5
5
  SHA512:
6
- metadata.gz: a7edf680a26cc6dd614573001e6bf4b247649ab8c9fe9de64483a97621d4bf13c2e1a95703642257588ac3076cc5a4de05453da0d91bf7cc321037a1c177d547
7
- data.tar.gz: 7b8207e7e7041eca074828ebb34be141a01e05cce4c2bdb35473d5a7eaa2e2a6d4cc5327340d11d92ad444a9f039ae585c4e68b4d6250d18fee65e447d7f3c01
6
+ metadata.gz: fb98f01ec30d09a8a16da7b70f97804a78e9e9458849235fa9d661c3ea2e59e01a42729a5b2ccb9321d93888bdb70da0f0b0a25d13620c6dfffd65f587a46601
7
+ data.tar.gz: e81e0db24b35638b6a0b7ebd75e3037029a256877d32cf97231d1e74cfc28a0a57193819eea75cf5961c3a6629a3a55e0aa144e8a54d04e9983e4de42204bc19
@@ -8,7 +8,7 @@ require "strscan"
8
8
  module TermColorLight
9
9
  module_function
10
10
 
11
- VERSION = "1.1.0"
11
+ VERSION = "1.1.1"
12
12
 
13
13
  TAGS = {
14
14
  # foreground colors
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termcolorlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - whiteleaf7