cotonti.com : Pre tags are being stripped https://www.cotonti.com Последние сообщения в теме Cotonti en Wed, 15 Oct 2025 20:38:49 -0000 Macik #39495 Hodges:

Hi Macik,

The code <pre class="brush:xml;">TEXT</pre> reduces to <pre>TEXT</pre> whilst <pre class="brush">TEXT</pre> is left unaltered. I still haven't figured this out yet.  I don't understand why this isn't happening on cotonti.com since I'm using HTML Purifier as it ships with Cotonti Siena 0.9.16.

I checked it on my old install (0.9.10) and it worked with default HTML purifier setting. By the way both variants works:  <pre class="brush:xml;"> and <pre class="brush:xml">

]]>
пт, 02 мая 2014 16:32:51 -0000
Hodges Hi Macik,

The code <pre class="brush:xml;">TEXT</pre> reduces to <pre>TEXT</pre> whilst <pre class="brush">TEXT</pre> is left unaltered. I still haven't figured this out yet.

I don't understand why this isn't happening on cotonti.com since I'm using HTML Purifier as it ships with Cotonti Siena 0.9.16.

- Hodges

EDIT: I've just paused HTML Purifier whilst submitting a page and the class value was left unaltered so it's definitely HTML Purifier.

EDIT2: Although this isn't yet fixed, I've just realised I didn't have the parser plugin installed (I had assumed it shipped with stock cotonti). Anyway for those who don't know the link is here: https://github.com/trustmaster/cot-syntaxhighlighter

]]>
пт, 02 мая 2014 13:23:21 -0000
Macik Not 100%, but it can be HTML Purifier.

Try to experiment and save these tag with simple class:  <pre class="test">

If it works fine then special symbols is problem.

If it cleared (not saved) then check HTMLPurifier presets.

 

I'm checked this code on my page and it saved fine.

So look at these settings:

    'Attr.ForbiddenClasses' => '',

    'HTML.AllowedAttributes' => 'pre.class';

 

 

 

p.s. Using special symbols in class attrbut is not semantically right.

]]>
пт, 25 апр 2014 20:12:43 -0000
Hodges Good afternoon,

So it seems that when I insert a code snippet the class attribute (containing the markup language identifier, e.g. class="brush:xml;") is getting stripped out of the pre tag that's surrounding the code. It can't be CKEditor at fault because in plugins/ckeditor/lib/config.js:

	config.allowedContent = true; // disable ACF

So it must be HTML Purifier, right? Except everything I've read suggests it isn't that aggressive, and will leave class attributes alone.

Anyway, a little help here would be appreciated :)

]]>
пт, 25 апр 2014 14:45:00 -0000