markdiff 0.5.4 → 0.5.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e80f72a11886759cdc06f7808979e6ed0bad625a
|
4
|
+
data.tar.gz: 9cd7dc00d2f40c38a6a09f424da0719f57f00451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbcaaf7b68319e07798a1706b86acc4b7fc583e073c5c40e8cc41ef93ada23075d7053ba96019b03d2caeb02f146c01f508e3bdf236281cae8623607ecf6a4b2
|
7
|
+
data.tar.gz: fa5d376beedea28a30d8420174611841dde14e93ded018bd1ab90f26cae73f7d977bf084a5a2037e70d3616a04cde47fc7f1e86b4a1438951309840e8535e2c8
|
data/CHANGELOG.md
CHANGED
data/lib/markdiff/differ.rb
CHANGED
@@ -183,8 +183,11 @@ module Markdiff
|
|
183
183
|
# @param [Nokogiri::XML::Node] node
|
184
184
|
def mark_li_as_changed(node)
|
185
185
|
until node.parent.nil? || node.parent.fragment?
|
186
|
-
if node.name == "li"
|
187
|
-
node["class"]
|
186
|
+
if node.name == "li"
|
187
|
+
classes = node["class"].to_s.split(/\s/)
|
188
|
+
unless classes.include?("added") || classes.include?("changed") || classes.include?("removed")
|
189
|
+
node["class"] = (classes + ["changed"]).join(" ")
|
190
|
+
end
|
188
191
|
end
|
189
192
|
node = node.parent
|
190
193
|
end
|
@@ -6,7 +6,7 @@ module Markdiff
|
|
6
6
|
# @return [String]
|
7
7
|
def inserted_node
|
8
8
|
if @inserted_node.name == "li"
|
9
|
-
@inserted_node["class"] = "added"
|
9
|
+
@inserted_node["class"] = (@inserted_node["class"].to_s.split(/\s/) + ["added"]).join(" ")
|
10
10
|
@inserted_node.inner_html = "<ins>#{@inserted_node.inner_html}</ins>"
|
11
11
|
@inserted_node
|
12
12
|
else
|
@@ -7,7 +7,7 @@ module Markdiff
|
|
7
7
|
def inserted_node
|
8
8
|
if @inserted_node.name == "li"
|
9
9
|
node = @inserted_node.clone
|
10
|
-
node["class"] = "added"
|
10
|
+
node["class"] = (node["class"].to_s.split(/\s/) + ["added"]).join(" ")
|
11
11
|
node.inner_html = "<ins>#{@inserted_node.inner_html}</ins>"
|
12
12
|
node
|
13
13
|
else
|
data/lib/markdiff/version.rb
CHANGED