Closed tmm1 closed 11 years ago
I kinda like the class ivar thing we talked about earlier where we can do the type check once up front. I'd feel a lot safer using the klass value then.
Yea, maybe something like
EscapeUtils.html_string_class = ActiveSupport::SafeBuffer
That method can just raise if you try to use a non-class or non-subclass of String.
Added a fallback path for rbx. Although, it looks like the build is still failing because of rb_cvar_set
. Can't we use a simple ivar instead?
Yeah I guess we could just set a regular ivar on the class itself?
Hello. I encountered an issue concerning escape_util's CGI monkeypatch and the cocoon gem. The issue involves converting an ActiveSupport::SafeBuffer to a string in order to escape it properly. Please see https://github.com/nathanvda/cocoon/pull/191. Would setting something like EscapeUtils.html_string_class = ActiveSupport::SafeBuffer
resolve this issue? Thanks for the help!
Returns a custom subclass of String and optionally sets
@html_safe=true
in the new instance.