asciidoctor-external-callout 1.2.0 → 1.2.1

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: 9071bcc8bd5b3d881297e12f8a9f27cb9220dd4633584f35aa537a33b2a1ffcc
4
- data.tar.gz: 6e1e73370eb5ee7df1c5128f0178975ba30852c69b450fb0cb02e5ca105db3a6
3
+ metadata.gz: 988ee7db8d0166dee5024f3fb8d480d169b5e1b7ad5d520cdfa6d1732af8246c
4
+ data.tar.gz: d124ae287c1e1f8b3c046e58129da71ece998892b05cd3f31827fea2141098cf
5
5
  SHA512:
6
- metadata.gz: a62d43ad6fee410aa7d71862f71bb28ad67e12a44d102fce91ea5130c19b9ac14b5fbe905278eb9aaf6a2d39e347f99f8caadf68ae3c737119086ab17902455a
7
- data.tar.gz: 2a0671db148dd4c7e855fbd5e00a87c885167a31716fa387810e1cacc0368c9b4d0af3131b5b26fbf23834c40c74a4dd5fe579f13638524e37755f598a4dc668
6
+ metadata.gz: '0782b1b464338a58aebc8134b9586100461fd84fc0a6e929a2aa7233c3c0ad21c461c8d0270e4159e098ef4e87971a2942a48e056dba9fdcdc1dcadbc078e54a'
7
+ data.tar.gz: a02cc9f11cbd93ce43d5c8031af3033aa1c28ec9422e49b873af70afd22ae245dc0331784638dc6fb72e5fe07c26946e971f9ed82bcbb1ec4442fe9e5690b171
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Record of bug fixes, enhancements, and changes.
4
4
 
5
+ ## [1.2.1] – 2022-09-16
6
+
7
+ ### Fixed
8
+ - Fixed detection of source blocks that are nested inside other blocks.
9
+
5
10
  ## [1.2.0] – 2022-07-30
6
11
 
7
12
  ### Added
@@ -47,7 +47,7 @@ Asciidoctor::Extensions::register do
47
47
 
48
48
  if external_callout_list? list
49
49
 
50
- owner_block = owning_block list
50
+ owner_block = owning_block document, list
51
51
 
52
52
  owner_block.subs.replace(owner_block.subs + [:callouts]).uniq
53
53
 
@@ -99,13 +99,13 @@ Asciidoctor::Extensions::register do
99
99
 
100
100
  # Have a look at the next level up
101
101
  # to find the block that our CO list belongs to
102
- def owning_block(list)
102
+ def owning_block(document, list)
103
103
 
104
- list_parent = list.parent
104
+ all_blocks = document.find_by
105
105
 
106
- raise "There is no block above the callout list" if list_parent == nil
106
+ raise "There are no available blocks" if all_blocks == nil
107
107
 
108
- index_back = list_parent.blocks.index { |x| x == list }
108
+ index_back = all_blocks.index { |x| x == list }
109
109
 
110
110
  # We should be able to find our own block, but in case we can't …
111
111
  raise "Error – could not locate our ordered list" if index_back == nil
@@ -115,11 +115,11 @@ Asciidoctor::Extensions::register do
115
115
  index_back = index_back - 1
116
116
 
117
117
  # We have found our matching block
118
- return list_parent.blocks[index_back] if list_parent.blocks[index_back].context == :listing
118
+ return all_blocks[index_back] if all_blocks[index_back].context == :listing
119
119
 
120
120
  # We have hit another callout list, but there was no list block first.
121
121
  # Assume we have an error
122
- raise "Callout list found while seeking listing block" if list_parent.blocks[index_back].context == :colist
122
+ raise "Callout list found while seeking listing block" if all_blocks[index_back].context == :colist
123
123
 
124
124
  end
125
125
 
data/lib/version.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Asciidoctor
4
4
  module External
5
5
  module Callout
6
- VERSION = "1.2.0"
6
+ VERSION = "1.2.1"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-external-callout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Offiah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-30 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor