[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Stripping HTML tags
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 15 Aug 2005 17:08:52 -0300
> <a href="http://www.example.com" alt="> example"> example </a>
Maybe you could preprocess the string, finding all substrings inside
quotes and escaping "dangerous" characters to something else;
something like this (untested):
s = string.gsub(s, '".-"', function (p)
return string.gsub(p, "[<>%]", function (c)
return string.format("%02x", string.byte(c))
end)
end)
-- Roberto