jmcnevin / rubypants

RubyPants: SmartyPants for Ruby
Other
29 stars 20 forks source link

Bugfix for substituing opening quotes with preceding non-breaking space character #5

Closed jeffplang closed 8 years ago

jeffplang commented 9 years ago

A non-breaking space right before a single or double quotes always results in an entity(:single|double_right_quote) replacing it. This bug correctly detects the non-breaking space character and replaces with the appropriate entity.

agriffis commented 8 years ago

Relevant doc from http://ruby-doc.org/core-2.1.1/Regexp.html

POSIX bracket expressions are also similar to character classes. They provide a portable alternative to the above, with the added benefit that they encompass non-ASCII characters. For instance, /\d/ matches only the ASCII decimal digits (0-9); whereas /[[:digit:]]/ matches any character in the Unicode Nd category.

  • /\s/ - A whitespace character: /[ \t\r\n\f]/
  • /[[:space:]]/ - Whitespace character

@jmcnevin This looks good. Would you consider pulling it?