I want to encode HTML Scripts.
I have text like this:
"<a href="https://www.w, <script></script>"
I want to only decode
< and > to < and >.
I have a method like this:
def name
a = [last_name.to_s + ',', first_name].compact.join(' ')
Loofah.fragment(a).text(encode_special_chars: false)
end
But using Loofah.fragment it is decoding all html scripts ad showing like this:
"<a href=\"https://www.w, <script></script>" but I want only < and >
Could someone please help me.