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: 85c33ddb801f9755c49bfb41f96ec9e8ae51ec8d4ec69d5ff2bf7a7ac9af1476
4
- data.tar.gz: 1fe744e0153d34094992cb71eb8cd8500415e951ac49839d9804e3d6288fee39
3
+ metadata.gz: a21b3d521679fac57b4063144f7d92fe67ecb435ed6e1a96e6f6739453caa5cc
4
+ data.tar.gz: 8bc7cea7b212e5af44800ddda906b287ccd44036c0639d0e60f619d33ad01c5d
5
5
  SHA512:
6
- metadata.gz: 6964e495b8f4ace1179a0de5e0048dafa93c1fed93c66e803a5ee73f5285942e7a9418cc3fc96d8e89dbd289a785a6c3301d5c9d9b5c459272a622f3fb47938f
7
- data.tar.gz: 2a5e04b05af9082d6c11ec6d5d53588662fbfff6d681825059499170f764061416f06203dfbc94ee97098169bc36c6833c648a09bf2ad9e9dca4098a0a7e459d
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentfulConverter
4
- VERSION = '0.0.1.23'
4
+ VERSION = '0.0.1.24'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.23
4
+ version: 0.0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Avlonitis