Just to show how UTTERLY BRAINDEAD that code is, try this:
Code:
var txt = "In math, 3 < 5 is true and 10 > 12 is false";
alert( removeHtmlTag( txt, 9999 ) );
using that
removeHtmlTag code, as written.
You get an alert of
In math, 3 12 is false
The stupid code thinks that "< 5 is true and 10 >" is an HTML tag!!!
*********
Anyway, aside from the code being both braindead and ugly as pig snot, if you don't want to eliminate HTML tags from the blogposts, then you *could* simply change that function to
Code:
function removeHtmlTag( strx, chop ) { return strx; }
If you do want to remove HTML tags, then do it right:
Code:
function removeHtmlTag( strx, chop ) /* ignores chop! */
{
var re = /\<\/?[a-z][^\>]*\>/ig;
return strx.replace( re, "" );
}