-
Notifications
You must be signed in to change notification settings - Fork 115
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
Spaces disappearing #68
Comments
The same happened to my use-case. I have been using markdown which i have later on truncated and it turns out that markdown processing left some new lines in HTML code which in turn truncate_html deleted. I am currently working on a workaround... |
I figured out what it was: non-breaking spaces (unicode 160). See http://www.rubyinside.com/the-split-is-not-enough-whitespace-shenigans-for-rubyists-5980.html They are removed instead of being treated like regular spaces. |
This fixes the issue of non-breaking spaces being discarded, resulting in words being joined together. `\s` and `\S` only match on space (character 32). HTML often uses non-breaking spaces (character 160). A more general approach is to use `[[:space:]]` instead. According to the `Regexp` documentation, `[[:space:]]` matches "Whitespace character ([:blank:], newline, carriage return, etc.)" Fixes hgmnz#68
In this series, we’re interviewing NYCDA graduates to talk about their program...
gets truncated to
In this series, we’re interviewingNYCDA graduates to talk about their program...
The text was updated successfully, but these errors were encountered: