summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-06-02 12:11:55 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-06-02 12:11:55 -0600
commit79b45c738bdcfd2c4d8d18e3498b9d84efa1dfa5 (patch)
tree14e5aff56a03ba78412913f1da6286275f998ccb
parentf3b1c79b1672c06b5d4c4dfae0a8fb09cfad9ac5 (diff)
change root and jail keys for SVG root to base and root, respectively
-rw-r--r--lib/asciidoctor/pdf/converter.rb6
-rw-r--r--lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb4
-rw-r--r--lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index feb29e34..c846307a 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -939,7 +939,7 @@ module Asciidoctor
height: label_height,
fallback_font_name: fallback_svg_font_name,
enable_web_requests: allow_uri_read ? (method :load_open_uri).to_proc : false,
- enable_file_requests_with_root: { root: (::File.dirname icon_path), jail: @jail_dir },
+ enable_file_requests_with_root: { base: (::File.dirname icon_path), root: @jail_dir },
cache_images: cache_uri
svg_obj.resize height: label_height if svg_obj.document.sizing.output_height > label_height
svg_obj.draw
@@ -1734,7 +1734,7 @@ module Asciidoctor
file_request_root = false
else
svg_data = ::File.read image_path, mode: 'r:UTF-8'
- file_request_root = { root: (::File.dirname image_path), jail: @jail_dir }
+ file_request_root = { base: (::File.dirname image_path), root: @jail_dir }
end
svg_obj = ::Prawn::SVG::Interface.new svg_data, self,
position: alignment,
@@ -4049,7 +4049,7 @@ module Asciidoctor
def resolve_image_options image_path, image_format, image_attrs, opts = {}
if image_format == 'svg'
image_opts = {
- enable_file_requests_with_root: { root: (::File.dirname image_path), jail: @jail_dir },
+ enable_file_requests_with_root: { base: (::File.dirname image_path), root: @jail_dir },
enable_web_requests: allow_uri_read ? (method :load_open_uri).to_proc : false,
cache_images: cache_uri,
fallback_font_name: fallback_svg_font_name,
diff --git a/lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb b/lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb
index 58be47fd..4db675f1 100644
--- a/lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb
+++ b/lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb
@@ -5,8 +5,8 @@ Prawn::SVG::Loaders::File.prepend (Module.new do
def initialize root_path
if Hash === root_path
- @jail_path = root_path[:jail]
- root_path = root_path[:root]
+ @jail_path = root_path[:root]
+ root_path = root_path[:base]
super
else
super
diff --git a/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb b/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb
index c4639a10..2bdf98a7 100644
--- a/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb
+++ b/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb
@@ -68,7 +68,7 @@ module Asciidoctor::PDF::FormattedText
width: image_w,
fallback_font_name: doc.fallback_svg_font_name,
enable_web_requests: doc.allow_uri_read ? (doc.method :load_open_uri).to_proc : false,
- enable_file_requests_with_root: { root: (::File.dirname image_path), jail: doc.jail_dir },
+ enable_file_requests_with_root: { base: (::File.dirname image_path), root: doc.jail_dir },
cache_images: doc.cache_uri
svg_size = svg_obj.document.sizing
# NOTE: the best we can do is make the image fit within full height of bounds