Opened 12 years ago
Last modified 12 years ago
#10204 confirmed New Feature
Introduce editor.htmlProcessor for input HTML processing
Reported by: | Piotrek Koszuliński | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | 4.0 Beta |
Keywords: | Cc: |
Description (last modified by )
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 the current architecture this is clearly impossible to replace editor.dataProcessor with e.g. markdownDataProcessor, because pasted data will be processed as... a markdown input.
Therefore I'm proposing to introduce second property - the editor.htmlProcessor. There will be two properties now:
- editor.dataProcessor - used for 1st kind of input (setData()),
- editor.htmlProcessor - used for 2nd kind of input (pasted, inserted HTML).
This 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/inserting HTML like it does now.
Change History (3)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
Status: | new → confirmed |
---|---|
Version: | → 4.0 Beta |
Pushed t/10204 with a prototype of the solution.