Opened 7 years ago

Closed 7 years ago

#10191 closed Task (fixed)

Always extract styles/classes/attrs required by ACRs before creating filter.allowedContent array to unify its format

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.1
Component: General Version: 4.1 RC
Keywords: Drupal Cc: wim.leers@…

Description

Now:

  • some ACRs available in filter.allowedContent array have styles/classes/attrs required by them only marked with "!" characters.
  • some have their required styles/classes/attrs copied to requiredClasses/Styles/Attributes arrays.

We should always expose the second format.

Change History (7)

comment:1 Changed 7 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:2 Changed 7 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.1

comment:3 Changed 7 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:4 Changed 7 years ago by Wim Leers

Cc: wim.leers@… added
Keywords: Drupal added

I reported this while working on http://drupal.org/node/1894644.

comment:5 Changed 7 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/10191 on dev and tests.

I thought that this patch will be pretty simple, but it isn't :)

  • All added rules are now pushed to filter.allowedContent in standardized format. All kinds of elements/styles/classes/attrs validators are transformed to objects like:

{ foo: true, bar: true }.

I chose objects rather than arrays because in the future we may need to add values validators (styles values and attributes values) and then objects will be the only solution to keep both - names and values.

  • I removed support for function and regexp based validators, since they were not used anywhere and aren't serializable (so they cannot be easily reused on e.g. PHP side). Instead, we may want to introduce string validators with wildcards, e.g.: attributes: 'data-*'. Extracted to: #10202.
Last edited 7 years ago by Piotrek Koszuliński (previous) (diff)

comment:6 Changed 7 years ago by Olek Nowodziński

Status: reviewreview_passed

comment:7 Changed 7 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on major with git:97b4f24 on dev and c7b659d on tests.

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