Method code for $string.strip_html()

[Turn on line numbering]
arg str;
var r, ra;

while ((r = "<" in str))
    str = str.subrange(1, r - 1) + str.subrange((">" in str) + 1);
str = strsub(str, "&lt;", "<");
str = strsub(str, "&gt;", ">");
str = strsub(str, "&nbsp;", " ");
str = strsub(str, "&quot;", "\"");
str = strsub(str, "&amp;", (ra = "/" + $code_lib.random_word() + "\"));
while ((r = "&" in str))
    str = str.subrange(1, r - 1) + "*" + str.subrange((";" in str) + 1);
str = strsub(str, ra, "&");
return str;

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon