hanami / view

Views, templates and presenters for Ruby web applications
http://hanamirb.org
MIT License
173 stars 80 forks source link

Mark blocks captured from templates as HTML safe #230

Closed timriley closed 1 year ago

timriley commented 1 year ago

This is important for Part or Scope methods (including the helpers we’ll soon be shipping) that want to determine whether to escape strings captured from template blocks based on whether they are .html_safe?.

It's the primary job of templates to create HTML, so it makes sense for all template-captured blocks to be marked as HTML safe in the first place.

jodosha commented 1 year ago

@timriley Bingo! This was one of the problems I ran into during my tests, and I forgot about it.