Replace all ">"(>) which are inside <code> tags
Posted
by Micke
on Stack Overflow
See other posts from Stack Overflow
or by Micke
Published on 2010-06-06T11:04:37Z
Indexed on
2010/06/06
11:12 UTC
Read the original article
Hit count: 553
ruby-on-rails
|ruby
How can i replace all >
with >
and <
with <
inside a <code>
tag with ruby?
For example:
<code><script>
alert('I steal cookies');</script></code>
With:
<code><script>alert('I steal cookies);<script><code>
The reason for this is because the h() method escapes all the < and >
Thanks, Micke
© Stack Overflow or respective owner