Welcome! » Log In » Create A New Profile

how to remove empty html tag

Posted by wonderer 
wonderer
how to remove empty html tag
April 28, 2011 10:36AM

Hi there!

I have a string like : "This is a <a href="javascript:func();">link</a>that is to be removed."

After purified, it becomes

"This is a <a>link</a>that is to be removed."

As there is no attributes on the <a> and </a>, they are meaningless now. I want purifier completely remove the tags while keeping the text inside (i.e. "link") the tag there. Is it possible?

I have turned on the AutoFormat.RemoveEmpty option but it seens not work in this case.

Re: how to remove empty html tag
April 28, 2011 10:42AM

I think someone managed to hack this up by setting href to be a required attribute. There's not a built-in way to do this though.

Sorry, you do not have permission to post/reply in this forum.