summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarat Radchenko <marat@slonopotamus.org>2020-11-25 11:43:06 +0300
committerMarat Radchenko <marat@slonopotamus.org>2020-11-25 11:43:06 +0300
commite287b88db7baf8dfd9328cebc66c0f07d27a84e4 (patch)
treed0da289896ac81067b9de7c7a96c98466fb6cd18 /lib
parent99b9f29b02e312109672f0498350fddb0b4807ab (diff)
resolves #382 use CSS for image size scaling instead of `width` attribute
`width` attribute cannot be percentage in EPUB3, unlike in HTML.
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor-epub3/converter.rb2
1 files changed, 1 insertions, 1 deletions
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