Opened 11 years ago

Last modified 11 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 Piotrek Koszuliński)

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 11 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:2 Changed 11 years ago by Jakub Ś

Status: newconfirmed
Version: 4.0 Beta

comment:3 Changed 11 years ago by Piotrek Koszuliński

Pushed t/10204 with a prototype of the solution.

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