relaton-w3c 1.3.2 → 1.3.3

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: d7dd4430200f1bc42ef19c5e7efd4eb0bee2167d17c80ca44533f0b08e6bdfe6
4
- data.tar.gz: 62b4b98f90f7541d8099647f287e94cbe62600ef5943bcd7e315b7d8990f8424
3
+ metadata.gz: 42a40987b4156671fee680b2ef9eb9a6b42f5a356f62c09d7f56eaf9ae466578
4
+ data.tar.gz: dcd2de5ae0c8582a2dc3fb29473faee5367c81cf48a394f6cf09b45134c66e0d
5
5
  SHA512:
6
- metadata.gz: 5480d5eb9a41ef48c7e4a9237f793e96016c32ed3b1cd982b784f4e3e8f0ba84de136b13993ef7a5d6d2fda92540cf5be98339fd198bc93e5486e572958a5feb
7
- data.tar.gz: 12de49efbd61c4417ba7d31062f63560883cbe46f5ca9405218e84cb7d815f2717ea691cfd83175aff5b072cc44f7c3284fea526991d9395e9c47789d283b593
6
+ metadata.gz: b94a6b93e792f44145b7b70139c673e534addc6989272c623ccfd3a1828b3376755f7193ca9dbcf35049f169a9c0084c3e8111977653ccb62fb5e8d7a2a18c9b
7
+ data.tar.gz: 272f89a76aeceacd9db2366cd80a0316023c3594a9fc058bed048b883ecea0dd07e63769e14988da0ea6506581ebd0d76539ee4097750bab5ee9ea5b415f6b24
@@ -46,9 +46,12 @@ module RelatonW3c
46
46
  title ||= title_date
47
47
  result = data.select do |hit|
48
48
  (hit["title"].casecmp?(title) ||
49
- hit["link"].split("/").last.match?(/#{title}/)) &&
49
+ hit["link"].split("/").last.match?(/-#{title}-/)) &&
50
50
  type_date_filter(hit, type, date)
51
51
  end
52
+ if result.empty?
53
+ result = data.select { |h| h["link"].split("/").last.match? /#{title}/ }
54
+ end
52
55
  result.map { |h| Hit.new(h, self) }
53
56
  end
54
57
 
@@ -48,13 +48,14 @@ module RelatonW3c
48
48
  def fetch_title(hit, doc) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
49
49
  titles = []
50
50
  if doc
51
- title = doc.at("//h1[contains(@id, 'title')]")&.text
52
- titles << { content: title, type: "main" } if title
51
+ title = doc.at("//*[contains(@id, 'title')]")&.text
52
+ titles << { content: title, type: "main" } if title && !title.empty?
53
53
  subtitle = doc.at(
54
54
  "//h2[@id='subtitle']|//p[contains(@class, 'subline')]"
55
55
  )&.text
56
56
  titles << { content: subtitle, tipe: "subtitle" } if subtitle
57
- elsif hit["title"]
57
+ end
58
+ if titles.empty? && hit["title"]
58
59
  titles << { content: hit["title"], type: "main" }
59
60
  end
60
61
  titles.map do |t|
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.3.2".freeze
2
+ VERSION = "1.3.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-w3c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase