-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prawn::Format issue on tag #37
Comments
I believe this is caused by not passing all the options through to width_of in Prawn:Document::Text#wrapped_text so prawn-format doesnt get the :plain option and tries to parse it for tags |
@twalpole: that's not what it is, since Prawn::Format does some heavy extensions to Prawn and doesn't use any of the original functions. (Unless I missed something) |
This is the wrong tracker, since it's a prawn-format issue. I've recreated the ticket here: |
Actually -- I believe when the :plain option is detected prawn-formats text_with_formatting calls back to the original prawn-core which it has aliased as text_without_formatting. The original prawn-core text then calls the original wrapped_text which calls "width_of(e, :kerning => options[:kerning])". This has been aliased from prawn-layouts width_of_with_formatting BUT since the prawn-core call to width_of has stripped out the :plain option (because it only passes the :kerning option for some reason) - then width_of_with_formatting no longer knows that the :plain option was used and attempts to process the text as if it contains formatting. Passing all options through to width_of should fix this issue - unless there is a specific reason only :kerning is passed |
Oh, interesting point. I'll look into it. |
Hi,
I got an error
/usr/lib64/ruby/gems/1.8/gems/prawn-format-0.2.0.1/lib/prawn/
format/parser.rb:120:in `start_parse': closing b, but no tags are open
(Prawn::Format::Parser::TagError)
when displaying text like that
pdf.text "this is simple plain text where plain = true
", :plain => true
This is working fine in earlier version.
The text was updated successfully, but these errors were encountered: