zachinglis / crummy

Tasty breadcrumbs! Crummy is a simple and tasty way to add breadcrumbs to your Rails applications.
http://zachinglis.com
MIT License
358 stars 82 forks source link

A fix for the escaped html problem in :html_list #26

Closed fotos closed 12 years ago

fotos commented 12 years ago

Hey,

a patch for the problem described here: https://github.com/zachinglis/crummy/commit/ec82d85dacad3879ae4462a2e13106c395903622#commitcomment-974228

Hopefully it's straightforward enough to understand the change. :)

-fotos

fotos commented 12 years ago

Is there something you didn't like in the proposed patch that I should fix or you just didn't have enough time to review and pull the patch in?

simonc commented 12 years ago

:up:

sheerun commented 12 years ago

+1

MPV commented 12 years ago

+1

DimaSavitsky commented 12 years ago

+1

nikosd commented 12 years ago

+1

rafaelss commented 12 years ago

+1

nahue commented 12 years ago

+1

proton commented 12 years ago

+1

nlib commented 12 years ago

+2

andreydjason commented 12 years ago

+1

kirs commented 12 years ago

@zachinglis Could you merge it plz?

kstevens715 commented 12 years ago

+1

zachinglis commented 12 years ago

I've been mixed on this, because I feel like it's up to the user to decide whether to safe it or not. But due to the overwhelming response of people wanting this in… I'm up for it.

fotos commented 12 years ago

@zachinglis thanks for pulling this in.

For the record, it's still up to the user to decide. If he passes in a html_safe string we don't make it unsafe. In other words we don't change the safeness of the string. We just keep it the way it was. The problem was that all strings returned by the block became unsafe by default and there was nothing you could do by the time #content_tag was called (where the HTML was escaped). That's what this patch fixed. Hope this clears it up.

kstevens715 commented 12 years ago

Thanks @zachinglis and @fotos!