Opened 15 years ago
Closed 15 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 15 years ago by
Keywords: | Pending added |
---|
comment:2 Changed 15 years ago by
Hi Tobiasz,
i put in the line:
<span class="wysiwyg_protected">%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>"}%</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 15 years ago by
Cc: | alex.stoffers@… added |
---|
comment:4 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
Hi, what change are you having with that HTML macro ?
Could you provide some reproduction steps ?