card-mod-legacy 0.11.4 → 0.11.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
  SHA256:
3
- metadata.gz: 7d0db2f8f5528291c80f415bad75bbe9c4250956d30c23a47f3d2d0cf82359e3
4
- data.tar.gz: 4e03652f099d9626b3d1d3c537e8f5870eb84d0dd629ba19baf36a59d0f3acbc
3
+ metadata.gz: 5e2b5284365cd104ea3cd2789745620715c88be0246a7ec3d0d855490a1fd3c0
4
+ data.tar.gz: e9473e21eeb924633a59349f0b7e7da0f78770fa6815617816e6a056a8755892
5
5
  SHA512:
6
- metadata.gz: 9c650f5e7f43d4b98bc73a2cc61ba8ae97b21e626092192b0a102474d62b425018a38eb028cc44f79a5d01fccb48eba619dc41df0913d771dc4f5a9f54e5c50a
7
- data.tar.gz: 0c2507e0901084a0e114bf2310750bbdef7b6fb38507ec520c3f75de5daa1829cfa3951c83cad09c4b3e05e2238c743280d33a70af9522dcbb7df8200872f19e
6
+ metadata.gz: 8b0057a046639f3860ed9d274b45a18ae7a7159a7b713cb63dbbbc4792a471ee4209f4bbbe399e03c44ab9df9e6b3036b27beb97b86b9080f7897b1fd4c0f29e
7
+ data.tar.gz: 0ddb39f60610c6af34b430517a22dbbd49381d2dbe87a5675bcc7c425b6b8c70cd08c62fe63b6ddb3b1e51d80ff1cfb059e14457f43de94f398294912c2b7196
@@ -17,10 +17,12 @@ format :html do
17
17
  toc = toc_items content
18
18
  return unless toc.flatten.length >= toc_minimum
19
19
 
20
- content.replace(
21
- %( <div class="table-of-contents"> <h5>#{t :legacy_toc}</h5> ) +
22
- make_table_of_contents_list(toc) + "</div>" + content
23
- )
20
+ content.replace(%(
21
+ <div class="table-of-contents">
22
+ <h5>#{t :legacy_toc}</h5>
23
+ #{make_table_of_contents_list toc}
24
+ </div>#{content}
25
+ ))
24
26
  end
25
27
 
26
28
  def toc_minimum
@@ -30,11 +32,12 @@ format :html do
30
32
  def toc_items content
31
33
  toc = []
32
34
  dep = 1
33
- content.gsub!(/<(h\d)>(.*?)<\/h\d>/i) do |match|
35
+ content.gsub!(%r{<(h\d)>(.*?)</h\d>}i) do |match|
34
36
  if $LAST_MATCH_INFO
35
37
  tag, value = $LAST_MATCH_INFO[1, 2]
36
38
  value = strip_tags(value).strip
37
39
  next if value.empty?
40
+
38
41
  item = { value: value, uri: URI.escape(value) }
39
42
  case tag.downcase
40
43
  when "h1"
@@ -59,6 +62,6 @@ format :html do
59
62
  %(<li><a href="##{i[:uri]}"> #{i[:value]}</a></li>)
60
63
  end
61
64
  end.join("\n")
62
- "<ol>" + list + "</ol>"
65
+ "<ol>#{list}</ol>"
63
66
  end
64
67
  end
data/set/type/basic.rb CHANGED
@@ -1 +1 @@
1
- include_set Abstract::TableOfContents
1
+ include_set Abstract::TableOfContents
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-legacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-05-05 00:00:00.000000000 Z
13
+ date: 2021-05-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.4
21
+ version: 1.101.5
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.101.4
28
+ version: 1.101.5
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org