diff --git a/CHANGELOG.md b/CHANGELOG.md index fa75547..f5b58bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,51 @@ All notable changes to this project will be documented on . +# [0.11.0] - 2024-10-11 + +### Add `escape_once` helper + +It escapes HTML without affecting existing escaped entities +```crystal +class ExamplePage + include Blueprint::HTML + + def blueprint + plain escape_once("1 < 2 & 3") + + span escape_once("<< Accept & Checkout") + + span { escape_once("") } + end +end + +puts ExamplePage.new.to_s +``` + +Output: +```html +1 < 2 & 3 + +<< Accept & Checkout + +<script>alert('content')</script> +``` + +### Change attribute value escaper +Before attribute values were escaped using `HTML.escape`, now the escape is done using `.gsub('"', """)`. + +```crystal +class ExamplePage + include Blueprint::HTML + + def blueprint + input(value: %(>'test'<">)) + # Before + # After + end +end +``` + # [0.10.0] - 2024-10-11 ### Allow any type `#plain`/`#comment` methods diff --git a/shard.yml b/shard.yml index a13d06d..c920bfe 100644 --- a/shard.yml +++ b/shard.yml @@ -2,7 +2,7 @@ name: blueprint description: | A lib for writing reusable and testable views templates (HTML, SVG, Forms) in plain Crystal. Inspired by Phlex. -version: 0.10.0 +version: 0.11.0 authors: - Stephann V. <3025661+stephannv@users.noreply.github.com> diff --git a/src/blueprint/version.cr b/src/blueprint/version.cr index 405cef5..4e1413b 100644 --- a/src/blueprint/version.cr +++ b/src/blueprint/version.cr @@ -1,3 +1,3 @@ module Blueprint - VERSION = "0.10.0" + VERSION = "0.11.0" end