jessedoyle / prawn-icon

Easy icons for Prawn.
Other
28 stars 15 forks source link

icon in string interpolation inside prawn text method fails to render #51

Closed atstockland closed 3 years ago

atstockland commented 3 years ago

If I use

text "Test: #{ icon 'fa-helicopter', size: 6 }", size: 9, color: '555555', inline_format: true

I get

image Test: #Prawn::Icon:0x00007fba4a9b68e0>

the expected outcome is

Test: image

Am I using this incorrectly or is string interpolation not supported?

jessedoyle commented 3 years ago

Hey @atstockland, thanks for using Prawn::Icon!

There's no need to use Prawn's text method directly for inline-formatted icons.

This snippet should work:

icon 'Test: <icon size="6">fas-helicopter</icon>', size: 9, color: '555555', inline_format: true
atstockland commented 3 years ago

Thanks! I misread the docs. That works great.