When I add a link to a text or an image in the Visual Editor and change the destination setting to “_self”, it automatically goes back to “_blank” when saving. I also tried to change the HTML code by myself, but the issue keeps occurring. What should I do to solve the issue (if possible, I do not want to change something in the JavaScript)?
Hmm, I don’t think we have anything in the system that will automatically set the target for a link you make in a text field like that.
There’s a configuration for the HTML filter that sets which targets are allowed, right now only _blank is in that list. You should be able to work around this by disabling “Use HTMLPurifier” under Settings → Security, though note that this will disable all HTML filtering completely. But: this filter should just be removing non-blank targets, not changing them to blank.
I guess you’re just trying _self because a target is showing up even when you don’t set one? (As _self in most cases will be the same as just not setting a target at all.) I’ve just gone and double-checked and I don’t have any problem making links with the usual default of no target. Maybe you have something else in place, a module perhaps, that’s setting the _blank target on all links?
I’m using these modules, but I don’t think any of these one are the source of the issue: Block Plus, Bulk Export, Common, CSSEditor, CSV Import, Custom Ontology, Custom Vocab, Fields as Tags, Log, Page Blocks, Zotero Import.
In the image in the HTML field, I tried changing the link’s destination to a new target by changing it to “_self” without any success. However, after unchecking “Utiliser HTMLPurifier” in “Paramètres → Sécurité”, changed the target to “_self”, save the changes, tested it (it works), then again checking “Utiliser HTMLPurifier”, the issue does not occur anymore yet. Thanks for the help!