Opened 17 years ago

Closed 17 years ago

#533 closed Bug (invalid)

ProtectedTags not working for custom FontFormats tag

Reported by: dc Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

I added a custom tag to the FCKConfig.FontFormats list, named it in the language file, added it to the fckeditorcode_ie.js and fckeditorcode_gecko.js files and added it to the FCKConfig.ProtectedTags list. When using the Format dropdown to change a selected portion of text to custom format eveything seems to work fine until the document is saved or Source view is toggled. At that point the text disappears completely. Using firebug, I found a problem with the element inserted by FCKeditor.

Before changing the selected text to the custom format the element was:

<p>
test text
</p>

After the formatting change the element was:

<<toc> _moz_dirty="">
test text
</<toc>>

When I switch to Source view the element disappears. I assume this happened because the element is malformed.

When I edited the tag in firebug to look like:

<toc _moz_dirty="">
test text
</toc>

And toggled Source view it worked properly. I tested this in both Firefox2 and IE7.

Change History (3)

comment:1 Changed 17 years ago by dc

The ProtectedTags line in fckconfig.js is:

FCKConfig.ProtectedTags = 'toc';

And the FontFormats line is:

FCKConfig.FontFormats	= 'toc;p;div;pre;address;h1;h2;h3;h4;h5;h6';

comment:2 Changed 17 years ago by slurms

I have noticed that you need to have a p tag in the content, otherwise in source view tags by themselves disappear. (in firefox)

e.g. in source view enter: <customtag/> toggle source back and forth and it will disappear.

This seems to be fixed in the nightly demo however: http://www.fckeditor.net/nightly/fckeditor/_samples/default.html

comment:3 Changed 17 years ago by Frederico Caldeira Knabben

Resolution: invalid
Status: newclosed

It is not possible to define custom tags in the FontFormats list. You may remove some of those in the list, but not add your custom ones. This is an intrinsic browser limitation.

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