Open parys-github opened 3 years ago
Seems that this is done here and a few other places
// If you are sure other plugins can't add `target` - drop check below
var aIndex = tokens[idx].attrIndex('target');
if (aIndex < 0) {
tokens[idx].attrPush(['target', '_blank']); // add new attribute
} else if(!tokens[idx].attrs[aIndex][1]) {
tokens[idx].attrs[aIndex][1] = '_blank'; // replace value of existing attr
}
@luke- PR here: https://github.com/humhub/humhub-prosemirror/pull/78 Thanks @ArchBlood for indicating which file it was!
@luke- PR here: https://github.com/humhub/humhub-prosemirror/pull/78 Thanks @ArchBlood for indicating which file it was!
I would also like to note the following lines as well; https://github.com/humhub/humhub-prosemirror/blob/master/src/editor/core/util/linkUtil.js#L21-L38
@luke- Should we close this issue? However, the fix has not been released yet: https://github.com/humhub/humhub-prosemirror/blob/develop/docs/CHANGELOG.md -> Enh #61
Btw there is another type of internal links, for example ?test=value
or #test=value
which will add query or hash to the current url
Rich Text Editor - Link TARGET issue
This is the problem and the same time feature request. I register that the Rich Text Editor a specially the LINK tool has the wrong label [Link target] and this is very confusing. Actually the field with this label is responsible for the URL not for the target attribute. Right now all a:href elements int the posts sections are rendered with the target="_blank" attribute.
It seems that from a User Experience perspective it would be very desirable to change the label: [Link target] => [Link URL] and adding the new field
[Link target] with dropdown which allows users to conditionally select options for the target attribute: _blank or _self
I think this is a very common situation that when writing a post, we want to refer to articles in the area of the parent (local) domain without the need to open a new window or a separate tab.
I must admit that I am aware that this is not a tiny update but a major improvement but from the user's perspective it will be a very helpful and undeniably useful feature.
Thank you very much for your great work and an almost perfect script. I keep my fingers crossed for new improvements.
Cheers Marek