forked from github/cinny
fix: add noreferrer to sanitized links for improved privacy consistency (#2628)
Enhance privacy by adding noreferrer to sanitized links
This commit is contained in:
@@ -100,7 +100,7 @@ const transformATag: Transformer = (tagName, attribs) => ({
|
|||||||
tagName,
|
tagName,
|
||||||
attribs: {
|
attribs: {
|
||||||
...attribs,
|
...attribs,
|
||||||
rel: 'noopener',
|
rel: 'noreferrer noopener',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -112,7 +112,7 @@ const transformImgTag: Transformer = (tagName, attribs) => {
|
|||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
attribs: {
|
attribs: {
|
||||||
href: src,
|
href: src,
|
||||||
rel: 'noopener',
|
rel: 'noreferrer noopener',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
},
|
},
|
||||||
text: attribs.alt || src,
|
text: attribs.alt || src,
|
||||||
|
|||||||
Reference in New Issue
Block a user