brianmario / yajl-ruby

A streaming JSON parsing and encoding library for Ruby (C bindings to yajl)
http://rdoc.info/projects/brianmario/yajl-ruby
MIT License
1.48k stars 169 forks source link

HTML Safe is the opposite of rails convention #210

Open SampsonCrowley opened 2 years ago

SampsonCrowley commented 2 years ago

Now, I'm very aware this is not a Rails gem; but what you've called the html_safe flag, even though your usage is much more accurate to the name of the flag (and while I also hate the way the rails guys named that one in particular), I think you could take a page from the rails book there. The rails convention is everything not flagged should be escaped, and adding html_safe means you've already escaped and cleared it.

The same concepts maybe don't apply here because it's a JSON library; but just food for thought