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

Nonbreaking space directive "\~" raises NoMethodError #18

Open
toupeira opened this issue Feb 27, 2024 · 0 comments
Open

Nonbreaking space directive "\~" raises NoMethodError #18

toupeira opened this issue Feb 27, 2024 · 0 comments

Comments

@toupeira
Copy link

Ran into this while parsing some RTFs in the wild, here's a minimal test case:

{\rtf1 \~}
$ RubyRTF::VERSION
=> "0.0.5"
$ RubyRTF::Parser.new.parse('{\rtf1 \~}')
NoMethodError: undefined method `[]' for nil:NilClass
from [...]/gems/ruby-rtf-0.0.5/lib/ruby-rtf/parser.rb:107:in `parse_control'

Seems like \~ should be a valid directive according to https://www.biblioscape.com/rtf15_spec.htm?

My workaround for now is just to replace instances of \~ with whitespace characters before passing them to RubyRTF::Parser.

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

No branches or pull requests

1 participant