diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2020-11-25 11:43:06 +0300 |
|---|---|---|
| committer | Marat Radchenko <marat@slonopotamus.org> | 2020-11-25 11:43:06 +0300 |
| commit | e287b88db7baf8dfd9328cebc66c0f07d27a84e4 (patch) | |
| tree | d0da289896ac81067b9de7c7a96c98466fb6cd18 /lib | |
| parent | 99b9f29b02e312109672f0498350fddb0b4807ab (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.rb | 2 |
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 |
