Opened 10 years ago

Closed 9 years ago

#5038 closed Bug (wontfix)

Impossible to add new format tag using configuration settings

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description

To add new format_tag according to the documentation it is enough to add something like:

config.format_pre = { element : 'pre', attributes : { class : 'code' } };

in the configuration object.

Unfortunately also a new language entry is needed by the format plugin in the onRender() function:

if ( tag != currentTag )
	this.setValue( tag, editor.lang.format[ 'tag_' + tag ] );

Because there are no language entries for "unknown" tags, CKEditor is displaying them as "undefined" in Format combo box.

This can be solved by #1032 but should be also documented better when #1032 is fixed.

Change History (3)

comment:1 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Pending added; Confirmed removed

The fact is that the format combo is not really made to accept any tag other than those set by default. This is by design.

Which other tags would you like to have there?

comment:2 Changed 10 years ago by Wiktor Walc

I've seen an attempt to add there code, dt and dd tags.

I can imagine also having there also a totally new tag styled as a block element that will be later parsed into something else on the server side.

comment:3 Changed 9 years ago by Frederico Caldeira Knabben

Keywords: Pending removed
Resolution: wontfix
Status: newclosed

In fact <code> is an inline element, so it would never work there. <dt> and <dd> are also special cases and we need dedicated plugins for them.

Anyway, we're not supposed to bring changes to the format combo. Actually, it can be totally deprecated by the Styles combo, which makes it possible to define any number and kind of block and inline styles. It should be used in that case.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy