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
Unexpected errors on empty filters #970
Comments
Closed
It seems like maybe this could be solved with a deprecation warning/error? It shouldn't be surprising that major version upgrades come with breaking changes. |
Could you provide a minimum template which reproduces the problem? I haven't been able to reproduce your problem so far.
|
Well, looks like I merged a patch which fixed the issue 😅 #986 |
So please try the latest Haml. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
after recent haml update (from 4.0.7 to 5.0.4) I noticed that filters may raise unexpected errors when there is no content. For example in 4.0 it was safe to have
:css
with no content. After update to 5.0 when:css
have no content css filter will receivenil
as text argument and will fail trying to dotext.rstrip
.haml/lib/haml/filters.rb
Line 236 in c1b38ed
It looks like previously strings were passed to filters but now if there is no content filter will receive
nil
instead. So some filters will raise unexpected errors while others won't depending on how they are implemented.The text was updated successfully, but these errors were encountered: