8
0

dataprocessor.jsdoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /**
  6. * @module engine/dataprocessor/dataprocessor
  7. */
  8. /**
  9. * The data processor interface. It should be implemented by actual data processors.
  10. *
  11. * Each data processor implements a certain format of the data. For example, {@glink features/markdown Markdown data processor}
  12. * will convert the data (a Markdown string) to a {@link module:engine/view/documentfragment~DocumentFragment document fragment} and back.
  13. *
  14. * **Note:** While the CKEditor 5 architecture supports changing the data format, in most scenarios we do recommend sticking to
  15. * the default format which is HTML (supported by the {@link module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor}).
  16. * HTML remains [the best standard for rich-text data](https://medium.com/content-uneditable/a-standard-for-rich-text-data-4b3a507af552).
  17. *
  18. * And please do remember – using Markdown [does not automatically make your
  19. * application/website secure](https://github.com/ckeditor/ckeditor5-markdown-gfm/issues/16#issuecomment-375752994).
  20. *
  21. * @interface DataProcessor
  22. */
  23. /**
  24. * Converts a {@link module:engine/view/documentfragment~DocumentFragment document fragment} to data.
  25. *
  26. * @method #toData
  27. * @param {module:engine/view/documentfragment~DocumentFragment} fragment The document fragment to be processed.
  28. * @returns {*}
  29. */
  30. /**
  31. * Converts the data to a {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  32. *
  33. * @method #toView
  34. * @param {*} data The data to be processed.
  35. * @returns {module:engine/view/documentfragment~DocumentFragment}
  36. */