Welcome! » Log In » Create A New Profile

How to use span style tag?

Posted by Extremefall 
How to use span style tag?
February 05, 2011 07:06AM

Hi, i need help with my Code. I try to use this code: <code><![CDATA[<span style="font-weight: bold;">Text</span>]]></code>. But the output is <code><![CDATA[<span>Text</span>]]></code>. I tried to allow the Elements and Attributes, but it does not work as well. My Code for HTML Purifier: <pre><![CDATA[ $config->set('HTML.AllowedElements', 'span,strong,p,b,a,i,img'); $config->set('HTML.AllowedAttributes', '*.style, img.alt, img.src, a.href'); ]]></pre> I hope, you can help me.

Re: How to use span style tag?
February 05, 2011 07:21AM

Do you by any chance have magic quotes turned on?

Re: How to use span style tag?
February 05, 2011 07:26AM

No, it is off. Do i also need HMTL.Allowed?

Re: How to use span style tag?
February 05, 2011 07:28AM

Does it work if you remove the two lines you quoted above?

Re: How to use span style tag?
February 05, 2011 07:34AM

Unfortunately it does not work as well.

Re: How to use span style tag?
February 05, 2011 07:36AM

Can you paste the full code you're using to call HTML Purifier? Are you sure that magic quotes is off? Did you accidentally escape the HTML for database before passing it to HTML Purifier?

Re: How to use span style tag?
February 05, 2011 07:39AM

Oh, i found out that magic_quotes_gpc are On. Might this cause the mistake?

Re: How to use span style tag?
February 05, 2011 07:42AM
Re: How to use span style tag?
February 05, 2011 08:08AM

Thank you so much. It works fine. =)

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: