metanorma-standoc 3.1.7 → 3.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 154ca8c34101aef7d0dfb0cad7c1bf0cfafaf3df110a0fef56a7d524b17a7d5b
4
- data.tar.gz: 7904a365e5bbaf50e159e164c5fc11e74d356f48a50de19889433f015eb9040d
3
+ metadata.gz: 8f9dbe3941901bd06b1d493edd4fd500dc586fb067d74acabdb57827ffd1185c
4
+ data.tar.gz: beb8a1972200318ed816475c263785333fdbfcc0657250602dfc4612cc935796
5
5
  SHA512:
6
- metadata.gz: 5d50a9d2df00a760fe948b97d28f50652c09fe313942a48d2648018a68edf4e783d62288d965e9a34225b4804bdae4bf483f4c47317fcb2188590ecf4b4495e5
7
- data.tar.gz: 616012d1b9ceaafbfd255aed0d477e66e201affece833b21413529c7ee2172c708400bc63422f3b29d460ca1d5b787a420f111b7cbfa7ec11deb46f103da893c
6
+ metadata.gz: '08a120c27f5e2bdfb9f86e8b459bd859f7de1b3d2188fa9050ffacd4dc4cd56dc77ac410856cd7a559f73340be5d1e6655c56aab83032fc869060b37c9df91ae'
7
+ data.tar.gz: 21c8fbe6de245752b97baff1a8d186b40de89da53f063e9722882276e200a76a8afb45ad12871e9e084adebc3c774639fc6a2bf7c715a90d3df762413b887285
@@ -1,27 +1,28 @@
1
1
  module Metanorma
2
2
  module Standoc
3
3
  module IsolatedConverter
4
- # Create an isolated Asciidoctor conversion that doesn't interfere with
4
+ # Create an isolated Asciidoctor conversion that doesn't interfere with
5
5
  # the current converter's instance variables
6
6
  def isolated_asciidoctor_convert(content, options = {})
7
7
  # Track that we're in an isolated conversion (for nested calls)
8
+ @isolated_conversion_stack ||= []
8
9
  @isolated_conversion_stack << true
9
-
10
+
10
11
  begin
11
12
  # Ensure we get a completely fresh Document and conversion context
12
13
  # Each call to Asciidoctor.convert creates a new Document with its own converter
13
14
  # This naturally isolates the conversion from the current instance variables
14
-
15
+
15
16
  # Save critical options that should be preserved from the current context
16
17
  preserved_options = extract_preserved_options(options)
17
-
18
+
18
19
  # Merge with isolated options to ensure clean state and skip validation
19
20
  isolated_options = preserved_options.merge(options).merge(
20
21
  attributes: (preserved_options[:attributes] || {}).merge(
21
- 'novalid' => '' # Force no validation for isolated documents
22
- )
22
+ "novalid" => "", # Force no validation for isolated documents
23
+ ),
23
24
  )
24
-
25
+
25
26
  # Perform the isolated conversion
26
27
  Asciidoctor.convert(content, isolated_options)
27
28
  ensure
@@ -33,20 +34,20 @@ module Metanorma
33
34
  private
34
35
 
35
36
  # Extract options that should be preserved from the current conversion context
36
- def extract_preserved_options(user_options)
37
+ def extract_preserved_options(user_opt)
37
38
  options = {}
38
-
39
+
39
40
  # Preserve safe mode to maintain security context
40
- options[:safe] = user_options[:safe] if user_options.key?(:safe)
41
-
41
+ options[:safe] = user_opt[:safe] if user_opt.key?(:safe)
42
+
42
43
  # Preserve local directory context if not explicitly overridden
43
- options[:base_dir] = @localdir if @localdir && !user_options.key?(:base_dir)
44
-
44
+ @localdir && !user_opt.key?(:base_dir) and
45
+ options[:base_dir] = @localdir
46
+
45
47
  # Preserve attributes that are safe to share
46
- if user_options[:attributes].nil? && respond_to?(:safe_shared_attributes)
48
+ user_opt[:attributes].nil? && respond_to?(:safe_shared_attributes) and
47
49
  options[:attributes] = safe_shared_attributes
48
- end
49
-
50
+
50
51
  options
51
52
  end
52
53
 
@@ -55,9 +56,9 @@ module Metanorma
55
56
  # Only include read-only or configuration attributes
56
57
  # Avoid any attributes that could cause state pollution
57
58
  {
58
- 'source-highlighter' => 'html-pipeline', # Use simple highlighter
59
- 'nofooter' => '',
60
- 'no-header-footer' => ''
59
+ "source-highlighter" => "html-pipeline", # Use simple highlighter
60
+ "nofooter" => "",
61
+ "no-header-footer" => "",
61
62
  }
62
63
  end
63
64
  end
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "3.1.7".freeze
22
+ VERSION = "3.1.8".freeze
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 3.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.