Ckeditor5: Create writer for non-semantic view manipulation

Created on 14 Aug 2018  路  4Comments  路  Source: ckeditor/ckeditor5

While working on Paste from Word (see https://github.com/ckeditor/ckeditor5/issues/1184 or https://github.com/ckeditor/ckeditor5-paste-from-word) there is a need to manipulate the view instance which was created from pasted HTML.

The ViewElement class has all the necessary methods which enables to manipulate view elements, however those methods are protected and should not be used outside. There is also a Writer class, however it is strictly designed to manipulate the view which was created based on the model (so the semantic one) and should not be used for non-semantic/dirty view manipulation.

There is a need for simple Writer class which can be used to manipulate non-semantic view (as we initially agreed it can be a simple wrapper for all Element manipulation methods).

The name proposals:

  • Upcast/DowncastWriter (so the current Writer will be renamed)
  • Semantic/NonsemanticWriter (same as above)
  • RawWriter, LowWriter, LowLevelWriter, GenericWriter
  • BasicWriter, BaseWriter
engine

Most helpful comment

GhostWriter 馃槢

All 4 comments

I wonder if the new writer should be a regular class or just class containing static methods? Since it is more like a proxy for an Element protected methods it will not use this anywhere. All methods could be just static.

OTOH, we may want to keep it consistent to what we have in a current Writer so it is very similar to use - then it should be possible to create instances of the new writer. WDYT?

GhostWriter 馃槢

OTOH, we may want to keep it consistent to what we have in a current Writer so it is very similar to use - then it should be possible to create instances of the new writer. WDYT?

I'd make it consistent with the current Writer. Of course, different methods will be available there, but the whole class should be used in the same way.

Agree. We need to keep them consistent. Also, both should have similar methods names and parameters order. We do not need to have the same methods since it does not makes sense for some cases, but in cases when it makes sense we should keep it consistent.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devaptas picture devaptas  路  3Comments

hybridpicker picture hybridpicker  路  3Comments

jodator picture jodator  路  3Comments

pjasiun picture pjasiun  路  3Comments

Reinmar picture Reinmar  路  3Comments