What's Changed
Add escape_once
helper
It escapes HTML without affecting existing escaped entities
class ExamplePage
include Blueprint::HTML
def blueprint
plain escape_once("1 < 2 & 3")
span escape_once("<< Accept & Checkout")
span { escape_once("<script>alert('content')</script>") }
end
end
puts ExamplePage.new.to_s
Output:
1 < 2 & 3
<span><< Accept & Checkout</span>
<span><script>alert('content')</script></span>
Change attribute value escaper
Before attribute values were escaped using HTML.escape
, now the escape is done using .gsub('"', """)
.
class ExamplePage
include Blueprint::HTML
def blueprint
input(value: %(>'test'<">))
# Before <input value=">'test'<">">
# After <input value=">'test'<">">
end
end
Full Changelog: v0.10.0...v0.11.0