Welcome! » Log In » Create A New Profile

Filter for remove tags

Posted by Vlad 
Vlad
Filter for remove tags
April 04, 2017 10:13AM

Hello!

How I can remove ˂p˃ only if it inside ˂td˃.

For example:

1. ˂p˃Hello, World!˂/p˃ ==> ˂p˃Hello, World!˂/p˃

2. ˂table˃˂tr˃˂td˃˂p˃Hello, World!˂/p˃˂/td˃˂/tr˃˂/table˃ ==˃ ˂table˃˂tr˃˂td˃Hello, World!˂/td˃˂/tr˃˂/table˃

Thanks!

Re: Filter for remove tags
April 04, 2017 11:39AM

If you add p to the excludes list of the td definition (look at the current code for 'a' tags, which excludes 'a', or also the code for 'pre') that should give you the effect you want.

Vlad
Re: Filter for remove tags
April 05, 2017 02:21AM

Please, can you give me some example or links, where I can read about it in detail?

Vlad
Re: Filter for remove tags
April 06, 2017 12:57AM

Thanks!

Vlad
Re: Filter for remove tags
April 10, 2017 07:51AM

Hello!

Can you help me? I am a newer in php.

I add this strings in tables.php:

$td = $this->addElement('td', false, 'Flow', 'Common', $cell_t);

$td->excludes = array('p' => true);

instead this (string 54):

$this->addElement('td', false, 'Flow', 'Common', $cell_t);

Buy now p is deleted along their content.

I want this:

˂table˃˂tr˃˂td˃˂p˃Hello, World!˂/p˃˂/td˃˂/tr˃˂/table˃ ==˃ ˂table˃˂tr˃˂td˃Hello, World!˂/td˃˂/tr˃˂/table˃

but I have this:

˂table˃˂tr˃˂td˃˂p˃Hello, World!˂/p˃˂/td˃˂/tr˃˂/table˃ ==˃ ˂table˃˂tr˃˂td˃˂/td˃˂/tr˃˂/table˃

Thanks!

Re: Filter for remove tags
April 10, 2017 08:30PM

Oh yeah, I think that's how exclude works. I guess to keep the text you'll need a different strategy, sorry :(

Vlad
Re: Filter for remove tags
April 11, 2017 12:51AM

I understand. OK. I will try do this with regEx. Thanks for answer!

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with < and >.

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:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: