contentful_converter 0.0.1.23 → 0.0.1.24
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a21b3d521679fac57b4063144f7d92fe67ecb435ed6e1a96e6f6739453caa5cc
|
4
|
+
data.tar.gz: 8bc7cea7b212e5af44800ddda906b287ccd44036c0639d0e60f619d33ad01c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c32f1a66a1c9d5c8e420238c389db5df46fe22a233a937c66e7e0c9fd4e8ecb7ce1feec1c391ee9391b9e92a9e37d69d6299fcca09d90f0531e096ee00180fb
|
7
|
+
data.tar.gz: a927f877e102ba6e06bcf26d627a5fd7950fcde70289999bfb7439b6a54b1ddf2c4e5a5bab62af28df7b7629f14d87a05a404ca1a45970e6684b264a5e97a89a
|
@@ -31,6 +31,7 @@ module ContentfulConverter
|
|
31
31
|
|
32
32
|
def remove_forbidden_elements(doc)
|
33
33
|
forbidden_nodes = ContentfulConverter.configure.configuration.forbidden_nodes
|
34
|
+
remove_empty_links(doc)
|
34
35
|
return if forbidden_nodes.empty?
|
35
36
|
|
36
37
|
find_nodes(doc, forbidden_nodes).each(&:remove)
|
@@ -46,6 +47,10 @@ module ContentfulConverter
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
50
|
+
def remove_empty_links(doc)
|
51
|
+
find_nodes(doc, 'a').each { |n| n.remove unless n['href'] }
|
52
|
+
end
|
53
|
+
|
49
54
|
def find_nodes(doc, element)
|
50
55
|
doc.css(*element)
|
51
56
|
end
|