From e287b88db7baf8dfd9328cebc66c0f07d27a84e4 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Wed, 25 Nov 2020 11:43:06 +0300 Subject: resolves #382 use CSS for image size scaling instead of `width` attribute `width` attribute cannot be percentage in EPUB3, unlike in HTML. --- lib/asciidoctor-epub3/converter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/asciidoctor-epub3/converter.rb b/lib/asciidoctor-epub3/converter.rb index 63dbba0..3c4d04e 100644 --- a/lib/asciidoctor-epub3/converter.rb +++ b/lib/asciidoctor-epub3/converter.rb @@ -997,7 +997,7 @@ document.addEventListener('DOMContentLoaded', function(event, reader) { # Unlike browsers, Calibre/Kindle *do* scale image if only height is specified # So, in order to match browser behavior, we just always omit height - img_attrs << %(width="#{width}") unless width.nil? + img_attrs << %(style="width: #{width}") unless width.nil? img_attrs end -- cgit v1.2.3