Skip to content
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

Closed
prashantkatare opened this issue Sep 22, 2009 · 5 comments
Closed

Prawn::Format issue on tag #37

prashantkatare opened this issue Sep 22, 2009 · 5 comments

Comments

@prashantkatare
Copy link

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.

@twalpole
Copy link

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

@practicingruby
Copy link
Member

@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)

@practicingruby
Copy link
Member

This is the wrong tracker, since it's a prawn-format issue.

I've recreated the ticket here:
http://github.com/sandal/prawn-format/issues/#issue/7

@twalpole
Copy link

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

@practicingruby
Copy link
Member

Oh, interesting point. I'll look into it.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants