Opened 10 years ago

Closed 6 years ago

#3841 closed Task (fixed)

Filter independent of writer

Reported by: Garry Yao Owned by:
Priority: Normal Milestone:
Component: Core : Output Data Version:
Keywords: Discussion Cc:

Description (last modified by Garry Yao)

The Problem

The current filter system doesn't respect filter rule priority:
When rule A is specified with priority higher than rule B when adding to filter system, what expected is all rules items of A will be applied before rules from B.
Unfortunatelly, the current system doesn't allow this happen: the current behavior is different, in which it only guarantee the priority of the same rule item, so one rule imposed on the parent node could never come later than it's child's rule.
If now we have

  • a rule entry in A, said, e.g. remove all empty <p>;
  • a rule entry in B, said, e.g. remove empty <a>;

Then there's no way to guarantee both rule's completeness.

The Solution

The reason is due to html filter is tightly binding to writer now, which does not allow it to run rules in multiple times, the rules is applied along with the writing process.
If we isolate the filter system out, it becomes more flexible:

  1. Allow "parsing once, filtering at will", with each filter rule changing the lightweight dom tree structure on the fly;
  2. Allow filter to alter node type easily;
  3. Write the whole document after all filters have applied.

Change History (6)

comment:1 Changed 10 years ago by Garry Yao

Description: modified (diff)

Tight up the description.

comment:2 Changed 10 years ago by Garry Yao

Description: modified (diff)

comment:3 Changed 10 years ago by Garry Yao

See this comment of #3782 as a concrete example of this problem.

comment:4 Changed 10 years ago by Frederico Caldeira Knabben

I don't see this one with good eyes becuase:

  • it impacts on the performance.
  • it could make things much more complicated.
  • it's quite unclear how to define the rules.
  • it's unclear when to call the filter (considering that an additional and dedicated filtering pass in the DOM tree is unwanted).

Anyway, still open for discussion.

comment:5 Changed 9 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

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

Resolution: fixed
Status: newclosed

Most (if not all) of the solution parts have been targeted and fixed in #9981.

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