Welcome! » Log In » Create A New Profile

remove a tag if followed by a particular tag

Posted by jpdupont 
remove a tag if followed by a particular tag
May 04, 2018 09:38AM

Hello, I must clean some html code from old articles of a cms. I want to remove <br/> tag followed by a </li>. How ? Or somme <br> codes used to push the space (br tags alone on a line)... Possible with HTML purifier, or I must use a regex replace ? Thanks !

Edited 1 time(s). Last edit at 05/04/2018 03:29PM by Ambush Commander.

Re: remove a tag if followed by a particular tag
June 09, 2018 10:36PM

HTML Purifier doesn't support it. Do a regex and then HTML Purify.

Your Email:


HTML input is enabled. Make sure you escape all HTML and angled brackets with &lt; and &gt;.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

Place code here

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}