ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

The "insertElement" method API docs links to itself instead of "insertElement" event

Open f1ames opened this issue 5 years ago • 6 comments

Type of report

Docs

Provide a description of requested docs changes

https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-insertElement should link to insertElement event, while it links to itself:

image

The interesting thing is that API docs seem to be correct linking to event so it needs further investigation.

f1ames avatar Nov 18 '20 09:11 f1ames

Looks like that's not the only case with method / event mismatch. Eg. same goes for https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-insertHtml

sculpt0r avatar Dec 02 '20 10:12 sculpt0r

~Found in umberto\scripts\filter\after-post-render\linker.js > linkToApi > docletByBaseAndHash() Just discovering what this code is doing, but~

// TODO The following code is buggy. E.g. for static method and instance method sharing the same name.
// Actually the `docletByBaseAndHash` should be just `doclet` - IDK why it was designed this way.
// This should be fixed in the future with tests on CKE5 and CKE4 codebases

~looks like it's worth it.~

sculpt0r avatar Dec 02 '20 10:12 sculpt0r

It works fine for http://localhost:9001/ckeditor4/4.15.1/api/CKEDITOR_editor.html#method-insertHtml with afterInsertHtml event (there is no method with this name), but fails with insertHtml event which is name-duplicated with the method.

sculpt0r avatar Dec 02 '20 11:12 sculpt0r

Browse back 4.XX.0 doc versions. I'm on 4.10.0 and this bug appears.

sculpt0r avatar Dec 02 '20 11:12 sculpt0r

JSDuck generate the same links href for both: working and broken events:

<a href=\"#!/api/CKEDITOR.editor-event-insertHtml\" rel=\"CKEDITOR.editor-event-insertHtml\" class=\"docClass\">insertHtml</a> 
<a href=\"#!/api/CKEDITOR.editor-event-afterInsertHtml\" rel=\"CKEDITOR.editor-event-afterInsertHtml\" class=\"docClass\">afterInsertHtml</a> 

Which makes umberto responsible for a bug.

sculpt0r avatar Dec 02 '20 11:12 sculpt0r

Umberto parseLinks(data) method already get's invalid link marker {@linkapi CKEDITOR.editor#method-insertElement insertElement}.

So https://github.com/ckeditor/ckeditor4/issues/4381#issuecomment-737149673 is rather invalid.

sculpt0r avatar Dec 07 '20 08:12 sculpt0r