asciidoctor-defmastership 1.0.8 → 1.0.10

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: d012bdd9c28ef271bbb1f65b6df7b46b1c4b423fb4445e8e55c4bdb73f7a43de
4
- data.tar.gz: 58ce5fc184f48878c8b7cd904e049a9a87bbb76d5a977beba4b0fad7a661cbfd
3
+ metadata.gz: 50c94ef32fb04c7d26f51b2bf66bacc22cc769c9d242087dbea838c6e29abc89
4
+ data.tar.gz: bbb7d84ab7db8e26f64f5eca89b724699f8dd89417fbf0015dbaf84081fbaefd
5
5
  SHA512:
6
- metadata.gz: 76fe2d67b3827039dd4d974c7bf329a417d7edfc57bf5d42542092055fd9e8c54d0169e5b36213b6777acefc267cbce4e2aedae877ba7bc5ff6316a9c428a888
7
- data.tar.gz: cd455d7722292309de19cf3788d9735a18fd6bd85bc7cab48f5165d9d3eaa61682fbdae70839884c649795f5155b0907b64f222affc1456d5fe9ab6f3023aead
6
+ metadata.gz: 85733bd136c5df20ae5d6003fa651fe418ca4038e0069c47edbe32ee8d57e50a9a8ae65ccd361343f716fca59d0957e782f9f83faa60bd914ea3283b0b76678c
7
+ data.tar.gz: 3304a8381022cc29b118f0e6fc0fd6076abb7a669bdb9dc56b2dd2b649f9cf093dcae7ef9bd52cd3546090a396b34184af0a83657e37245642a7ad93f01acda2
@@ -44,11 +44,14 @@ module Asciidoctor
44
44
 
45
45
  private_constant :REGEXPS
46
46
 
47
- def process(_document, reader)
47
+ def initialize(config = {})
48
+ super
48
49
  @has_url = Set.new
49
50
  @variables = {}
50
51
  @parsing_state = ::DefMastership::ParsingState.new
52
+ end
51
53
 
54
+ def process(_document, reader)
52
55
  return reader if reader.eof?
53
56
 
54
57
  reader.unshift_lines(parse_and_replace(reader.read_lines))
@@ -126,7 +129,11 @@ module Asciidoctor
126
129
  refname = matches[:reference]
127
130
  return ref unless @has_url.include?(refname)
128
131
 
129
- "link:{eref-#{refname}-url}##{ref}[#{ref}]"
132
+ ref_pattern =
133
+ @variables["eref-#{refname}-ref-pattern"] || '#%s'
134
+ ref_str = format(ref_pattern, ref)
135
+
136
+ "link:{eref-#{refname}-url}#{ref_str}[#{ref}]"
130
137
  end
131
138
 
132
139
  def show_ext_ref(matches)
@@ -4,7 +4,7 @@
4
4
  module Asciidoctor
5
5
  # main application module
6
6
  module DefMastership
7
- VERSION = '1.0.8'
7
+ VERSION = '1.0.10'
8
8
  public_constant :VERSION
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-defmastership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérôme Arbez-Gindre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2024-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor