[Nitro] Problem getting '<' and '>' into output

Robert Mela rob at robmela.com
Wed Sep 19 01:42:56 EDT 2007


I want this text to display in a blog post:

   #include <pthread.h>

I'm saving  this text to the Og model, and it gets to the database with 
the entities intact.

  #include &lt;pthread.h&gt;

However, the entities get translated into '<', '>' when the data is 
rendered in a template.  My workaround is two helper methods -- lt and 
gt that I include in templates as #{lt} and #{gt}. 

Suggestions?

Thanks,

    - Rob

PS:

Why the double CGI.unescape in attr.rb?


        prop_value = *CGI.unescape(prop_value)*

        if anno[:class] == String and anno[:unfiltered] != true
          # html filter all strings by default.
          prop_value = prop_value.html_filter
        end

        set_attr(obj, prop_name, *CGI.unescape(prop_value)*)


However, I want

I've set :unfilterd
Robert Mela wrote:
> Ah, I see...
>
> raw/lib/raw/util/attr.rb:
>
>
>        if anno[:class] == String and anno[:unfiltered] != true
>          # html filter all strings by default.
>          prop_value = prop_value.html_filter
>        end
>
> So in my model...
>
> attr_accessor :body, String, :control => :textarea, :unfiltered => true
>
> Robert Mela wrote:
>> Is there a simple way to get the Og admin part to stop stripping HTML 
>> from submitted text ?
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rob.vcf
Type: text/x-vcard
Size: 116 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070919/7ffd394a/attachment.vcf 


More information about the Nitro-general mailing list