Problem/Motivation

While using the linkit module and add target attribute. When we deselect the checkbox of "Open in new window". The CKEditor has not removed the target="_blank" attribute from the source code.

Steps

Following are the steps to follow to reproduce the bug,
1) Install and enable linkit module (8.x-4.3 version)
2) Add all the configuration. Add Target attribute from Manage Attribute tab.
3) Configure linkit in Text formats and editors (config/content/formats)
4) Add content and add link from select linkit option in CKEditor to given the link with checkbox of "Open in new window". Check the source code of CKEditor.
5) Update link from linkit option in CKEditor and deselect the checkbox of "Open in new window". Check source code of CKEditor.
6) See here, in source code of CKEditor, <p><a href="link" target="_blank">test</a></p> target attribute not be removed.

The response I got in ajax from Linkit module is working fine.

[{"command":"update_build_id","old":"form-l6OjCf7fckIlGn0MpaIdnIDB_N9jXbvW7XGOqhqrA38","new":"form-oi3OYG-UoUkZnHJKjlV0hqguG3T1jgC0TN3my_SzVDQ"},{"command":"editorDialogSave","values":{"attributes":{"href":"#"},"actions":{"save_modal":"Speichern"},"form_build_id":"form-oi3OYG-UoUkZnHJKjlV0hqguG3T1jgC0TN3my_SzVDQ","form_token":"pjof9If17pb4BJbhX7Haj8DcWJk8g9PbU_2sAqYglDU","form_id":"editor_link_dialog","op":"Speichern"}},{"command":"closeDialog","selector":"#drupal-modal","persist":false}]

Proposed resolution

When I deselect the checkbox, CKEditor should be removed target attribute from the source code as well.

Comments

latikas created an issue. See original summary.

latikas’s picture

Issue summary: View changes
Wim Leers’s picture

Project: Drupal core » Linkit
Version: 8.4.x-dev » 8.x-5.x-dev
Component: ckeditor.module » Code
Priority: Major » Normal
Issue tags: -CKEditor in core, -ckeditor
anon’s picture

Version: 8.x-5.x-dev » 8.x-4.x-dev
Anonymous’s picture

The same problem.

latikas’s picture

Yes, my mistake. Please mark one of them as a duplicate issue or remove it. Thanks.

lindsay.wils’s picture

I have the same issue, is there a solution as yet? thanks.

idebr’s picture

Status: Active » Closed (duplicate)
Related issues: +#2912517: Issue with removing attributes from the link

An earlier issue is available at #2912517: Issue with removing attributes from the link. I'll close this issue as a duplicate, so we can focus our efforts in the related issue.