tag_along 0.7.1 → 0.7.2

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: 819101f784c7940739f98d2ea7a46af410e0206d
4
- data.tar.gz: ec970bdddf053d5522ac3effa00f890fe7fad57b
3
+ metadata.gz: ac25ee81b70b583a4d8abbaceddcb486d842187c
4
+ data.tar.gz: f9f904f4f64b36993c41d3412e4ede96faa3847c
5
5
  SHA512:
6
- metadata.gz: c54655a5e5863266cdaeb2b77eff09e99521d3d7461f6ac5cf15e642b0c783b5ca911dd380253bd7cb8837b318f9c7f4c750bd3dfd940614f0e82349729c8885
7
- data.tar.gz: 20b14b77bf0d519153887117ed6b2e1c4a5a80db4f8a04d31ea58536a775dbecf958497e90a6231a6e72ee84a5b82faeaae0aa47cc076d935998ae9fa9b298fd
6
+ metadata.gz: ab9adeb46b91277bd35da4162e8cb10b4c4c89ad7a531e82d5150add3a3625e1661ecfb810d378a3cede77603f86198d329118b7fb40d3e995cc114da3d46f3a
7
+ data.tar.gz: 9820e99bad307af498964569c821f933359340bc64188f9badc8a8821dba91a3f79abd8ba1f9d11e7dd7b793597a624dc4f0a912c1122228d4048eeced386b71
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.7.2 -- end of the text preserved
2
+
1
3
  0.7.1 -- offsets can come in any order
2
4
 
3
5
  0.7.0 -- added dynamic tagging
@@ -1,3 +1,3 @@
1
1
  class TagAlong
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
data/lib/tag_along.rb CHANGED
@@ -62,6 +62,12 @@ class TagAlong
62
62
  fragment = []
63
63
  cursor = item.offset_end + 1
64
64
  end
65
+
66
+ unless text_ary.empty?
67
+ res << { tagged: false,
68
+ text: text_ary }
69
+ end
70
+
65
71
 
66
72
  res.each do |r|
67
73
  r[:text] = r[:text].pack('U*')
@@ -62,4 +62,12 @@ describe TagAlong do
62
62
  %q{There's <em>Sunday</em> and there's <em>Monday</em>}
63
63
  end
64
64
 
65
+ it 'should preserve the end of the text' do
66
+ text = 'There\'s Sunday and there\'s Monday for sure'
67
+ offsets = [[27,32], [8,13]]
68
+ tg = TagAlong.new(text, offsets)
69
+ tg.tag('<em>', '</em>').should ==
70
+ %q{There's <em>Sunday</em> and there's <em>Monday</em> for sure}
71
+ end
72
+
65
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tag_along
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin