devcenter-parser 1.4.1 → 1.4.2
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/devcenter-parser/header_id_generator.rb +2 -2
- data/lib/devcenter-parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45daa632ef49ab001185c85e8211264001fb5905
|
|
4
|
+
data.tar.gz: 7838fa926deb1ca2f6c9181fc33e93b4fb210d94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8bf5da01e7dd43a7479a68c0bd103a0851e5da59ca11ad4574e02015e0104d78a0cde3001a36486c693e0d4144af12c053c9fb56c38f277c97d432ea834775d
|
|
7
|
+
data.tar.gz: a1e0378ede29b79c4fd4e71a6bfd120f95f63a0b27a883ff27deeb6b341bedf0bb6a13eee9b84f172560d535adba5f12a5bea2c47e9a696c590ffa834f0b7e4e
|
|
@@ -30,8 +30,6 @@ class HeaderIdGenerator
|
|
|
30
30
|
append_numbers_on_conflicts
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
# Parent != DOM nesting, but in the context of the content <h2></h2> ... <h3></h3>
|
|
34
|
-
|
|
35
33
|
# Prepend parents recursively, one level at a time, until there are no conflicts or no changes in the result
|
|
36
34
|
def prepend_parents_on_conflicts(parent_index = 0)
|
|
37
35
|
original = @nodes_ids.dup
|
|
@@ -44,6 +42,8 @@ class HeaderIdGenerator
|
|
|
44
42
|
prepend_parents_on_conflicts(parent_index + 1) if original != @nodes_ids
|
|
45
43
|
end
|
|
46
44
|
|
|
45
|
+
# Parent != DOM nesting, but in the context of the content <h2></h2> ... <h3></h3>
|
|
46
|
+
|
|
47
47
|
def parent_header_nodes(node)
|
|
48
48
|
parent_tags(node.name).map do |parent_tag|
|
|
49
49
|
@header_nodes[0..@header_nodes.index(node)-1].select{ |sibling| sibling.name == parent_tag }.last
|