Skip to content

Nonbreaking space directive "\~" raises NoMethodError #18

Open
@toupeira

Description

@toupeira

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions