Ticket #11481 (reopened Feature Request)

Opened 5 years ago

Last modified 3 years ago

removing tinymce styles in importhandler should be possible

Reported by: frisi Owned by: robgietema
Priority: minor Milestone: 4.x
Component: Visual Editor Version: 4.0
Keywords: genericsetup, gs Cc: dpc22

Description

currently (Products.TinyMCE-1.1.6) it's just possible to add new styles

<styles>
 <element value="add this style|span|newstyle" />
</styles>

or overwrite all of them

<styles purge="True">
 <element value="just my style|span|newstyle" />
</styles>

what should be possible is to remove certain styles (eg added by another product) like it is possible for view_methods of portal_types

<styles purge="False">
 <element value="remove this style|span|newstyle" remove="True" />
</styles>

Change History

comment:1 Changed 4 years ago by kleist

  • Status changed from new to confirmed
  • Keywords genericsetup, added; genericsetup removed
  • Version set to 4.0

comment:2 follow-up: ↓ 3 Changed 3 years ago by ispburger

  • Status changed from confirmed to closed
  • Resolution set to fixed

Fixed in github 8fe9e8059e83a9a3d52d375be49b28f8e32944ca.

comment:3 in reply to: ↑ 2 Changed 3 years ago by dpc22

Replying to ispburger:

Fixed in github 8fe9e8059e83a9a3d52d375be49b28f8e32944ca.

Unfortunately this patch sorts the elements found in the <styles> section.

Consequently the following:

  <styles purge="True">
   <element value="Heading|h2| "/>
   <element value="Subheading|h3| "/>
   <element value="Sub-Subheading|h4| "/>
   <element value="Preformatted|pre| "/>
   <element value="Boxed/indented para|blockquote"/>
   <element value="Open quote|p|open-quote quote"/>
   <element value="Mid quote|p|quote"/>
   <element value="Close quote|p|close-quote quote"/>
   <element value="Quote citation|p|cite"/>
   <element value="Highlight|span|visualHighlight"/>
   <element value="Clear floats|div|visualClear"/>
   <element value="Pdf link|span|campl-icon campl-pdf-icon"/>
   <element value="Word link|span|campl-icon campl-word-icon"/>
   <element value="Excel link|span|campl-icon campl-excel-icon"/>
   <element value="Restricted link|span|campl-icon campl-lock-icon"/>
   <element value="Information link|span|campl-icon campl-info-icon"/>
   <element value="Help link|span|campl-icon campl-help-icon"/>
   <element value="Bulleted list|ul|disc"/>
   <element value="Lettered list lc|ol|lower-alpha"/>
   <element value="Lettered list uc|ol|upper-alpha"/>
   <element value="Roman-numbered list lc|ol|lower-roman"/>
   <element value="Roman-numbered list uc|ol|upper-roman"/>
   <element value="Superscript|span|sup"/>
   <element value="Subscript|span|sub"/>
  </styles>

ends up as:

Boxed/indented para|blockquote
Bulleted list|ul|disc
Clear floats|div|visualClear
Close quote|p|close-quote quote
Excel link|span|campl-icon campl-excel-icon
Heading|h2| 
Help link|span|campl-icon campl-help-icon
Highlight|span|visualHighlight
Information link|span|campl-icon campl-info-icon
Lettered list lc|ol|lower-alpha
Lettered list uc|ol|upper-alpha
Mid quote|p|quote
Open quote|p|open-quote quote
Pdf link|span|campl-icon campl-pdf-icon
Preformatted|pre| 
Quote citation|p|cite
Restricted link|span|campl-icon campl-lock-icon
Roman-numbered list lc|ol|lower-roman
Roman-numbered list uc|ol|upper-roman
Sub-Subheading|h4| 
Subheading|h3| 
Subscript|span|sub
Superscript|span|sup
Word link|span|campl-icon campl-word-icon

This is different from the old behaviour, and definitely isn't what we want.

Related styles (such as "Heading" and "Subheading") should be grouped together.

I can monkeypatch a copy of the old _importNode() back in , but it would be useful to get this fixed upstream.

comment:4 Changed 3 years ago by dpc22

  • Cc dpc22 added
  • Status changed from closed to reopened
  • Resolution fixed deleted
Note: See TracTickets for help on using tickets.