Opened 15 years ago

Last modified 11 years ago

#3841 closed Task

Filter independent of writer — at Initial Version

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

Description

===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 has applied.

Change History (0)

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