summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-03-15 17:36:28 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-03-15 17:36:28 -0600
commita1b77b9bfcf70a4c06ff8acc8f249b96c3287cdf (patch)
tree751777e6c7552c1b3d9dd54718826b2c04e1eab2
parentcf7ba3c79b97878f10f53467b6b55fc8c36119ea (diff)
export read_svg_contents method on built-in HTML 5 converter for Bespoke converter
-rw-r--r--lib/asciidoctor/converter/html5.rb5
-rw-r--r--test/converter_test.rb7
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/asciidoctor/converter/html5.rb b/lib/asciidoctor/converter/html5.rb
index e3d0467d..5c075e09 100644
--- a/lib/asciidoctor/converter/html5.rb
+++ b/lib/asciidoctor/converter/html5.rb
@@ -1181,6 +1181,11 @@ Your browser does not support the video tag.
end
end
+ # NOTE export _read_svg_contents as read_svg_contents for Bespoke converter
+ def read_svg_contents node, target
+ _read_svg_contents node, target
+ end
+
private
def _append_boolean_attribute name, xml
diff --git a/test/converter_test.rb b/test/converter_test.rb
index 359e8c2b..4f2ef2a8 100644
--- a/test/converter_test.rb
+++ b/test/converter_test.rb
@@ -590,5 +590,12 @@ context 'Converter' do
assert_kind_of Asciidoctor::Converter::CustomFactory, factory
assert_equal MyConverter, (factory.for 'mine')
end
+
+ test 'can call read_svg_contents on built-in HTML5 converter' do
+ doc = document_from_string 'image::circle.svg[]', base_dir: fixturedir
+ result = doc.converter.read_svg_contents doc.blocks[0], 'circle.svg'
+ refute_nil result
+ assert result.start_with? '<svg'
+ end
end
end