Skip to content

Commit 79b45c7

Browse files
committed
change root and jail keys for SVG root to base and root, respectively
1 parent f3b1c79 commit 79b45c7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/asciidoctor/pdf/converter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ def convert_admonition node
939939
height: label_height,
940940
fallback_font_name: fallback_svg_font_name,
941941
enable_web_requests: allow_uri_read ? (method :load_open_uri).to_proc : false,
942-
enable_file_requests_with_root: { root: (::File.dirname icon_path), jail: @jail_dir },
942+
enable_file_requests_with_root: { base: (::File.dirname icon_path), root: @jail_dir },
943943
cache_images: cache_uri
944944
svg_obj.resize height: label_height if svg_obj.document.sizing.output_height > label_height
945945
svg_obj.draw
@@ -1734,7 +1734,7 @@ def convert_image node, opts = {}
17341734
file_request_root = false
17351735
else
17361736
svg_data = ::File.read image_path, mode: 'r:UTF-8'
1737-
file_request_root = { root: (::File.dirname image_path), jail: @jail_dir }
1737+
file_request_root = { base: (::File.dirname image_path), root: @jail_dir }
17381738
end
17391739
svg_obj = ::Prawn::SVG::Interface.new svg_data, self,
17401740
position: alignment,
@@ -4049,7 +4049,7 @@ def resolve_explicit_width attrs, opts = {}
40494049
def resolve_image_options image_path, image_format, image_attrs, opts = {}
40504050
if image_format == 'svg'
40514051
image_opts = {
4052-
enable_file_requests_with_root: { root: (::File.dirname image_path), jail: @jail_dir },
4052+
enable_file_requests_with_root: { base: (::File.dirname image_path), root: @jail_dir },
40534053
enable_web_requests: allow_uri_read ? (method :load_open_uri).to_proc : false,
40544054
cache_images: cache_uri,
40554055
fallback_font_name: fallback_svg_font_name,

lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
def initialize root_path
77
if Hash === root_path
8-
@jail_path = root_path[:jail]
9-
root_path = root_path[:root]
8+
@jail_path = root_path[:root]
9+
root_path = root_path[:base]
1010
super
1111
else
1212
super

lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def arrange_images fragments
6868
width: image_w,
6969
fallback_font_name: doc.fallback_svg_font_name,
7070
enable_web_requests: doc.allow_uri_read ? (doc.method :load_open_uri).to_proc : false,
71-
enable_file_requests_with_root: { root: (::File.dirname image_path), jail: doc.jail_dir },
71+
enable_file_requests_with_root: { base: (::File.dirname image_path), root: doc.jail_dir },
7272
cache_images: doc.cache_uri
7373
svg_size = svg_obj.document.sizing
7474
# NOTE: the best we can do is make the image fit within full height of bounds

0 commit comments

Comments
 (0)