markdiff 0.4.0 → 0.5.0

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: 57c81d2928ea333fb0183a412d0577140b5f5215
4
- data.tar.gz: 80e6b8f960bf5b360d65b053f1628b56fa6dbe56
3
+ metadata.gz: d579e119bf15ea1d6629b7b6fb1f17d2fa2406a0
4
+ data.tar.gz: 35fa6ffd2804f296fe768b12f3ad550bd2551f2a
5
5
  SHA512:
6
- metadata.gz: 07028cae95a84c32e239c5788acb9a121c4049cb6f87a8ce95302080f8993bd5fe79f57c36e79f8f2d7d62eff3330de9d6ce098a96994a77cf90c5cc6ce57ae5
7
- data.tar.gz: 31e0e2023ee38182991c981ceb888837b702ce85f16bff101824b9def7d4fa3c46bed9fb678c9f9719f241b052e3b0cdfc3fffe472942eccbe77a75dd398a691
6
+ metadata.gz: 612cfea493d82b55cd8ddb35e7284584cf72b96fbc2b7603d9ef0c183653ad019d5183b6c69dd7463d4b741d27cba46f22318d7593b3664a95983afa7401d402
7
+ data.tar.gz: f7fc3e3dc5aad82b271d31d145f4674904e5e2d3da34d6b34e99ec3cab0103d30f584e2cfa99b62fe6808815df906962defe49d7c000f18bdf8c06049a0f3103
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.5.0
2
+ - Wrap changed nodes by div.changed
3
+
1
4
  ## 0.4.0
2
5
  - Chanage .changed specs
3
6
  - Fix bugs on text diff
@@ -202,7 +202,12 @@ module Markdiff
202
202
  # @param [Nokogiri::XML::Node] node
203
203
  def mark_top_level_node_as_changed(node)
204
204
  node = node.parent until node.parent.nil? || node.parent.fragment?
205
- node["class"] = "changed"
205
+ unless node.parent.nil? || node["class"] == "changed"
206
+ div = Nokogiri::XML::Node.new("div", node.document)
207
+ div["class"] = "changed"
208
+ node.replace(div)
209
+ div.children = node
210
+ end
206
211
  end
207
212
  end
208
213
  end
@@ -1,3 +1,3 @@
1
1
  module Markdiff
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler