Opened 16 years ago
Last modified 12 years ago
#3841 closed Task
Filter independent of writer — at Version 2
Reported by: | Garry Yao | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | |
Keywords: | Discussion | Cc: |
Description (last modified by )
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:
- Allow "parsing once, filtering at will", with each filter rule changing the lightweight dom tree structure on the fly;
- Allow filter to alter node type easily;
- Write the whole document after all filters have applied.
Change History (2)
comment:1 Changed 16 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 16 years ago by
Description: | modified (diff) |
---|
Tight up the description.