summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-01-10 23:48:28 -0700
committerDan Allen <dan.j.allen@gmail.com>2021-01-11 05:18:41 -0700
commitbce237f18dd151f5e019503af01f2101ce2642ea (patch)
treec40248781e764498e060f846b4f370ec67a65660
parent54813cbbfda731037e94f1ec1ec6f644207225ac (diff)
align warning message about allow-uri-read with core processor
-rw-r--r--lib/asciidoctor/pdf/converter.rb2
-rw-r--r--spec/admonition_spec.rb2
-rw-r--r--spec/cover_page_spec.rb2
-rw-r--r--spec/image_spec.rb4
-rw-r--r--spec/page_spec.rb2
-rw-r--r--spec/running_content_spec.rb2
6 files changed, 7 insertions, 7 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index 9e881017..17a8eb12 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -4220,7 +4220,7 @@ module Asciidoctor
# handle case when image is a URI
elsif is_uri || (imagesdir && (node.is_uri? imagesdir) && (image_path = node.normalize_web_path image_path, imagesdir, false))
if !allow_uri_read
- log :warn, %(allow-uri-read is not enabled; cannot embed remote image: #{image_path})
+ log :warn, %(cannot embed remote image: #{image_path} (allow-uri-read attribute not enabled))
return
elsif @tmp_files.key? image_path
return @tmp_files[image_path]
diff --git a/spec/admonition_spec.rb b/spec/admonition_spec.rb
index 1607b608..73faeb27 100644
--- a/spec/admonition_spec.rb
+++ b/spec/admonition_spec.rb
@@ -684,7 +684,7 @@ describe 'Asciidoctor::PDF::Converter - Admonition' do
(expect label_text).not_to be_nil
(expect pdf.lines).to eql ['TIP Use the icon attribute to customize the image for an admonition block.']
end).to log_messages [[
- { severity: :WARN, message: %(allow-uri-read is not enabled; cannot embed remote image: #{base_url}/tip.png) },
+ { severity: :WARN, message: %(cannot embed remote image: #{base_url}/tip.png (allow-uri-read attribute not enabled)) },
{ severity: :WARN, message: %(admonition icon not found or not readable: #{base_url}/tip.png) },
]]
end
diff --git a/spec/cover_page_spec.rb b/spec/cover_page_spec.rb
index 6853f360..5b2106e4 100644
--- a/spec/cover_page_spec.rb
+++ b/spec/cover_page_spec.rb
@@ -233,7 +233,7 @@ describe 'Asciidoctor::PDF::Converter - Cover Page' do
content
EOS
- end).to not_raise_exception & (log_message severity: :WARN, message: '~allow-uri-read is not enabled')
+ end).to not_raise_exception & (log_message severity: :WARN, message: '~allow-uri-read attribute not enabled')
(expect pdf.pages).to have_size 1
(expect pdf.find_text 'Document Title').to have_size 1
end
diff --git a/spec/image_spec.rb b/spec/image_spec.rb
index 0dc3e73b..e3e21744 100644
--- a/spec/image_spec.rb
+++ b/spec/image_spec.rb
@@ -1123,7 +1123,7 @@ describe 'Asciidoctor::PDF::Converter - Image' do
to_pdf %(image::#{image_url}[Remote Image]), analyze: true
end
(expect pdf.lines).to eql [%([Remote Image] | #{image_url})]
- end).to log_message severity: :WARN, message: '~allow-uri-read is not enabled; cannot embed remote image'
+ end).to log_message severity: :WARN, message: %r/^cannot embed remote image: .* \(allow-uri-read attribute not enabled\)$/
end
it 'should warn and show alt text if inline image is remote and allow-uri-read is not set' do
@@ -1134,7 +1134,7 @@ describe 'Asciidoctor::PDF::Converter - Image' do
to_pdf %(Observe image:#{image_url}[Remote Image]), analyze: true
end
(expect pdf.lines).to eql ['Observe [Remote Image]']
- end).to log_message severity: :WARN, message: '~allow-uri-read is not enabled; cannot embed remote image'
+ end).to log_message severity: :WARN, message: %r/^cannot embed remote image: .* \(allow-uri-read attribute not enabled\)$/
end
it 'should read remote image if allow-uri-read is set' do
diff --git a/spec/page_spec.rb b/spec/page_spec.rb
index 4ad015a2..b34d609a 100644
--- a/spec/page_spec.rb
+++ b/spec/page_spec.rb
@@ -681,7 +681,7 @@ describe 'Asciidoctor::PDF::Converter - Page' do
content
EOS
- end).to not_raise_exception & (log_message severity: :WARN, message: '~allow-uri-read is not enabled')
+ end).to not_raise_exception & (log_message severity: :WARN, message: '~allow-uri-read attribute not enabled')
end
it 'should set the background image using path specified in page-background-image attribute', visual: true do
diff --git a/spec/running_content_spec.rb b/spec/running_content_spec.rb
index debfa627..c80b4d75 100644
--- a/spec/running_content_spec.rb
+++ b/spec/running_content_spec.rb
@@ -2779,7 +2779,7 @@ describe 'Asciidoctor::PDF::Converter - Running Content' do
pdf = to_pdf 'body', analyze: true, pdf_theme: pdf_theme, enable_footer: true
footer_text = pdf.find_unique_text font_color: '0000FF'
(expect footer_text[:string]).to eql 'image:[fit=contain]'
- end).to log_message severity: :WARN, message: '~allow-uri-read is not enabled; cannot embed remote image'
+ end).to log_message severity: :WARN, message: %r/cannot embed remote image: .* \(allow-uri-read attribute not enabled\)$/
end
end