Opened 13 years ago
Last modified 13 years ago
#10204 confirmed New Feature
Introduce editor.htmlProcessor for input HTML processing — at Initial Version
| Reported by: | Piotrek Koszuliński | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Core : Output Data | Version: | 4.0 Beta |
| Keywords: | Cc: |
Description
There are two main input sources:
- data loaded to editor by
setData(), - and html inserted into editor when pasting or directly by
insertHtml().
Currently input data which comes from both of these sources is processed by the same data processor - htmlDataProcessor.
However, the idea of data processors is to be able to handle different data formats - e.g. markdown and bbcode.
Because of current architecture this is clearly impossible to replace editor.dataProcessor with e.g. markdownDataProcessor, because pasted data will be processed as... markdown input.
Therefore I'm proposing to introduce second dataProcessor - the editor.htmlProcessor. There will be to properties now:
- editor.dataProcessor - used for 1st kind of input (setData()),
- editor.htmlProcessor - used for 2nd kind of input (pasted, inserted HTML).
It is very simple fix - we need to set editor.htmlProcessor = editor.dataProcessor and use htmlProcessor instead of dataProcessor in editable.setData.
If one want to handle different input format he has to replace editor.dataProcessor with his own dataProcessor, what will not break pasting like it does now.
