Closed ghost closed 15 years ago
Contents of statements like his souldnt be encoded:
element.set_value("<[[CDATA[bla]]>")
It would be great If there was a way to prevent it.
A quick workaround could look like this:
module Common class NonEscapingString < String def gsub(arg) self end
def to_s self end
end end
Just wrap code that shouldn't be escaped with a NonEscapingString class. Not very beautiful.
You can now use the :raw option to add raw xml. Eg.:
:raw
element.set_value "<[[CDATA[bla]]>", :raw
Contents of statements like his souldnt be encoded:
element.set_value("<[[CDATA[bla ]]>")
It would be great If there was a way to prevent it.
A quick workaround could look like this:
module Common class NonEscapingString < String def gsub(arg) self end
end end
Just wrap code that shouldn't be escaped with a NonEscapingString class. Not very beautiful.