-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
#to_text
doesn't handle <br>
elements well.
#225
Comments
Hi, @der-flo! Thanks for pointing this out, that seems like a really good feature to add. I don't think we need a new scrubber for it, though, I think we should modify the current behavior of That scrubber currently adds newlines for "block" elements in HTML4 and HTML5 plus a loose set of elements that can contain block elements. But it doesn't pay attention to the element I'll write up a PR for this now, it should be a very small change. |
which probably should have always been the desired behavior Closes #225
Loofah 2.14.0 has been released with |
Your solution works fine, thanks! |
Happy to help! |
#to_text
doesn't handle<br>
elements explicitly, so phrases like"foo<br>bar"
get sanitzed to"foobar"
. In our use-case a line break ("foo\nbar"
) is a more practical result.So I wrote a custom scrubber:
Is this something valuable which should find it's way in the project via a pull request? If yes, could a maintainer give me implementation hints etc.? I'm willing to help.
The text was updated successfully, but these errors were encountered: