-
Notifications
You must be signed in to change notification settings - Fork 486
Fix html escaping on non strings #1958
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
Fix html escaping on non strings #1958
Conversation
camertron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at this @reeganviljoen!
| end | ||
| end | ||
|
|
||
| def test_inline_slot_html_escape_with_integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests don't appear to assert anything?
| def test_inline_slot_html_escape_with_integer | ||
| render_inline InlineSlotHtmlEscapeComponent.new(heading: "lorem ipsum", counter: 12, url: "/some_url") do |component| | ||
| component.with_empty_state do | ||
| "empty state" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense for this slot to return a non-string value? Otherwise we're testing the existing behavior and not the behavior mentioned in the issue.
|
Hey @reeganviljoen, in the interest of getting a release out today I forked your branch and created another PR with a few small fixes. Thanks for tackling this!! |
|
@camertron sorry I didd't see this as I was in the gym 😄 |
|
@reeganviljoen no worries! Sorry for closing, but your name is still in the changelog for this fix! |
|
@camertron no problem I fully understand the urgency, just letting you know I wasn't blowing off your response |
closes #1955
What are you trying to accomplish?
When an integer or any non-string is used inside call the html escaping throw an error(described in the linked issue)
What approach did you choose and why?
I replaced
text.nil? || text.empty?for with type safe.blank?so any type can be escaped as is allowed in templates