Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method signatures for the CKEDITOR.htmlDataProcessor class don't match the editor.dataProcessor API #5387

Open
Enquier opened this issue Dec 5, 2022 · 1 comment
Labels
status:confirmed An issue confirmed by the development team. type:docs The issue is related to documentation

Comments

@Enquier
Copy link

Enquier commented Dec 5, 2022

Type of report

Docs

Provide a description of requested docs changes

The method signatures of the htmlDataProcesser were updated in 4.3.0, but the documentation still shows the older "backwards compatible" method signatures

See:
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_htmlDataProcessor.html#method-toHtml

which has the now "options" field instead populated by an array.

@Enquier Enquier added the type:docs The issue is related to documentation label Dec 5, 2022
@jacekbogdanski
Copy link
Member

Thanks @Enquier, indeed I see that these signatures don't match with the CKEDITOR.htmlDataProcessor class -

/**
* Processes the (potentially malformed) input HTML to a purified form which
* is suitable for using in the WYSIWYG editable.
*
* This method fires the {@link CKEDITOR.editor#toHtml} event which makes it possible
* to hook into the process at various stages.
*
* **Note:** Since CKEditor 4.3.0 the signature of this method changed and all options
* are now grouped in one `options` object. Previously `context`, `fixForBody` and `dontFilter`
* were passed separately.
*
* @param {String} data The raw data.
* @param {Object} [options] The options object.
* @param {String} [options.context] The tag name of a context element within which
* the input is to be processed, defaults to the editable element.
* If `null` is passed, then data will be parsed without context (as children of {@link CKEDITOR.htmlParser.fragment}).
* See {@link CKEDITOR.htmlParser.fragment#fromHtml} for more details.
* @param {Boolean} [options.fixForBody=true] Whether to trigger the auto paragraph for non-block content.
* @param {CKEDITOR.filter} [options.filter] When specified, instead of using the {@link CKEDITOR.editor#filter main filter},
* the passed instance will be used to filter the content.
* @param {Boolean} [options.dontFilter] Do not filter data with {@link CKEDITOR.filter} (note: transformations
* will still be applied).
* @param {Number} [options.enterMode] When specified, it will be used instead of the {@link CKEDITOR.editor#enterMode main enterMode}.
* @param {Boolean} [options.protectedWhitespaces] Indicates that content was wrapped with `<span>` elements to preserve
* leading and trailing whitespaces. Option used by the {@link CKEDITOR.editor#method-insertHtml} method.
* @returns {String}
*/
toHtml: function( data, options, fixForBody, dontFilter ) {

I'm wondering if these couldn't be inherited using the @inheritdoc feature.

@jacekbogdanski jacekbogdanski changed the title method signatures for htmlDataProcessor are incorrect Method signatures for the CKEDITOR.htmlDataProcessor class don't match the editor.dataProcessor` API Dec 6, 2022
@jacekbogdanski jacekbogdanski changed the title Method signatures for the CKEDITOR.htmlDataProcessor class don't match the editor.dataProcessor` API Method signatures for the CKEDITOR.htmlDataProcessor class don't match the editor.dataProcessor API Dec 6, 2022
@jacekbogdanski jacekbogdanski added the status:confirmed An issue confirmed by the development team. label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. type:docs The issue is related to documentation
Projects
None yet
Development

No branches or pull requests

2 participants