Skip to content

Commit

Permalink
Merge pull request #682 from fap-/388-duplicate-inline-image-rendering
Browse files Browse the repository at this point in the history
resolves #388 Duplicate inline image rendering
  • Loading branch information
mojavelinux authored Dec 8, 2016
2 parents 0778f91 + 98fc393 commit 5361495
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def arrange_images fragments
# NOTE make room for the image by repeating the image placeholder character
# TODO could use character spacing as an alternative to repeating characters
# HACK we could use a nicer API from Prawn here to reserve width in a line
fragment[:text] = ImagePlaceholderChar * (fragment[:image_width] / spacer_w).ceil
spacer_cnt = (fragment[:image_width] / spacer_w).ceil
spacer_cnt -= 1 if spacer_cnt * spacer_w > available_width
fragment[:text] = ImagePlaceholderChar * spacer_cnt
#fragment[:width] = fragment[:image_width]
rescue => e
warn %(asciidoctor: WARNING: could not embed image: #{image_path}; #{e.message})
Expand Down

0 comments on commit 5361495

Please sign in to comment.