Opened 14 years ago

Closed 14 years ago

#5920 closed Task (invalid)

Prevent parsing of Custom Tags (protect tags but render anyways)

Reported by: Freizeitsoldat Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Pending Cc: alex.stoffers@…

Description

Hello,

i have a problem regarding some custom tags. I´m using the CKEditor for Foswiki, so i have to handle macro tags like

%MACRO{"adsfafds"}%

All these macros can be located in span elements with a given classname like "wysiwyg_protected".

What i´m trying to do no for 2 days is to prevent parsing of these tags in the ckeditor. Some special macros are changing when i switch between the source and wysiwyg mode, for example this macro snipet:

%SEARCH{ "1" type="query" scope="topic" nosearch="on" nototal="on" order="modified" reverse="on" limit="7" format="<dt>[[$topic]]</dt><dd>$summary<br /><span class='foswikiGrayText'>$date - $wikiusername</span></dd>"}%

I´m sure that the dataprocessor is parsing the html elements in the macro.

What i don´t want to do, is to put these macros into protectedSource, because i need to see them in my wysiwyg view as a fakeobject for example. I event need to change these macros, but in a controlled way.

I put a lot of time in trying to understand the dataprocessor but i would be really happy, if you can help me on this issue!

Thanks, Alex

Change History (4)

comment:1 Changed 14 years ago by Tobiasz Cudnik

Keywords: Pending added

Hi, what change are you having with that HTML macro ?

  • I use following content:
    <p>
    	<span class="wysiwyg_protected">%SEARCH{ &quot;1&quot; type=&quot;query&quot; scope=&quot;topic&quot; nosearch=&quot;on&quot; nototal=&quot;on&quot; order=&quot;modified&quot; reverse=&quot;on&quot; limit=&quot;7&quot; format=&quot;&lt;dt&gt;[[$topic]]&lt;/dt&gt;&lt;dd&gt;$summary&lt;br /&gt;&lt;span class=&#39;foswikiGrayText&#39;&gt;$date - $wikiusername&lt;/span&gt;&lt;/dd&gt;&quot;}%</span></p>
    
  • And switching between source/wysiwyg doesn't make a change to the content.

Could you provide some reproduction steps ?

comment:2 Changed 14 years ago by Freizeitsoldat

Hi Tobiasz,

i put in the line:

<span class="wysiwyg_protected">%SEARCH{ &quot;1&quot; type=&quot;query&quot; scope=&quot;topic&quot; nosearch=&quot;on&quot; nototal=&quot;on&quot; order=&quot;modified&quot; reverse=&quot;on&quot; limit=&quot;7&quot; format=&quot;&lt;dt&gt;[[$topic]]&lt;/dt&gt;&lt;dd&gt;$summary&lt;br /&gt;&lt;span class=&#39;foswikiGrayText&#39;&gt;$date - $wikiusername&lt;/span&gt;&lt;/dd&gt;&quot;}%</span></p>

After switching in source mode, i get:

<span class="WYSIWYG_PROTECTED">%SEARCH{ "1" type="query" scope="topic" nosearch="on" nototal="on" order="modified" reverse="on" limit="7" format="</span>

You see, the format is ruined...

If i put in normal macros without html tags inside (here it is <dd>, <dt>, <span class>, </br>, everything is working well.

comment:3 Changed 14 years ago by Freizeitsoldat

Cc: alex.stoffers@… added

comment:4 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: invalid
Status: newclosed

Evidently, you cannot have HTML in the macros, because it'll be rendered in the editor. Browsers don't know what a macro is... it's server side stuff.

So, you must definitely html-encode your macros. In this way they will be rendered properly in the editor: the user will see the macros just like they are, in wysiwyg mode.

The problem of course is source mode. Here, you really need to understand the data processor, performing "pre" and "post" processing in the data, encoding and decoding the macros as needed.

But, there is no editor bugs here. What you really need is support, so I would recommend you using our forums instead.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy