mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
Add rel="noreferrer noopener" to <a> with target="_blank" (#531)
* Add rel="noreferrer noopener" to <a> with target="_blank" * Run Prettier
This commit is contained in:
parent
c2cd169b64
commit
e19b9ac56e
5 changed files with 26 additions and 10 deletions
|
@ -52,11 +52,15 @@ class Footer extends React.Component {
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="http://stackoverflow.com/questions/tagged/"
|
href="http://stackoverflow.com/questions/tagged/"
|
||||||
target="_blank">
|
target="_blank"
|
||||||
|
rel="noreferrer noopener">
|
||||||
Stack Overflow
|
Stack Overflow
|
||||||
</a>
|
</a>
|
||||||
<a href="https://discordapp.com/">Project Chat</a>
|
<a href="https://discordapp.com/">Project Chat</a>
|
||||||
<a href="https://twitter.com/" target="_blank">
|
<a
|
||||||
|
href="https://twitter.com/"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer noopener">
|
||||||
Twitter
|
Twitter
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,6 +84,7 @@ class Footer extends React.Component {
|
||||||
<a
|
<a
|
||||||
href="https://code.facebook.com/projects/"
|
href="https://code.facebook.com/projects/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
rel="noreferrer noopener"
|
||||||
className="fbOpenSource">
|
className="fbOpenSource">
|
||||||
<img
|
<img
|
||||||
src={this.props.config.baseUrl + 'img/oss_logo.png'}
|
src={this.props.config.baseUrl + 'img/oss_logo.png'}
|
||||||
|
|
|
@ -44,7 +44,7 @@ class BlogPost extends React.Component {
|
||||||
if (post.authorFBID) {
|
if (post.authorFBID) {
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<a href={post.authorURL} target="_blank">
|
<a href={post.authorURL} target="_blank" rel="noreferrer noopener">
|
||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
'https://graph.facebook.com/' +
|
'https://graph.facebook.com/' +
|
||||||
|
@ -59,7 +59,7 @@ class BlogPost extends React.Component {
|
||||||
} else if (post.authorImage) {
|
} else if (post.authorImage) {
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<a href={post.authorURL} target="_blank">
|
<a href={post.authorURL} target="_blank" rel="noreferrer noopener">
|
||||||
<img src={post.authorImage} />
|
<img src={post.authorImage} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -110,7 +110,10 @@ class BlogPost extends React.Component {
|
||||||
<div className="authorBlock">
|
<div className="authorBlock">
|
||||||
{post.author ? (
|
{post.author ? (
|
||||||
<p className="post-authorName">
|
<p className="post-authorName">
|
||||||
<a href={post.authorURL} target="_blank">
|
<a
|
||||||
|
href={post.authorURL}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer noopener">
|
||||||
{post.author}
|
{post.author}
|
||||||
</a>
|
</a>
|
||||||
{post.authorTitle}
|
{post.authorTitle}
|
||||||
|
|
|
@ -31,7 +31,11 @@ class Doc extends React.Component {
|
||||||
this.props.metadata.custom_edit_url ||
|
this.props.metadata.custom_edit_url ||
|
||||||
(this.props.config.editUrl && this.props.config.editUrl + docSource);
|
(this.props.config.editUrl && this.props.config.editUrl + docSource);
|
||||||
let editLink = editUrl && (
|
let editLink = editUrl && (
|
||||||
<a className="edit-page-link button" href={editUrl} target="_blank">
|
<a
|
||||||
|
className="edit-page-link button"
|
||||||
|
href={editUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer noopener">
|
||||||
{editThisDoc}
|
{editThisDoc}
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
@ -50,7 +54,8 @@ class Doc extends React.Component {
|
||||||
'/' +
|
'/' +
|
||||||
this.props.language
|
this.props.language
|
||||||
}
|
}
|
||||||
target="_blank">
|
target="_blank"
|
||||||
|
rel="noreferrer noopener">
|
||||||
{translateThisDoc}
|
{translateThisDoc}
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,10 @@ class LanguageDropDown extends React.Component {
|
||||||
if (siteConfig.translationRecruitingLink) {
|
if (siteConfig.translationRecruitingLink) {
|
||||||
enabledLanguages.push(
|
enabledLanguages.push(
|
||||||
<li key="recruiting">
|
<li key="recruiting">
|
||||||
<a href={siteConfig.translationRecruitingLink} target="_blank">
|
<a
|
||||||
|
href={siteConfig.translationRecruitingLink}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer noopener">
|
||||||
{helpTranslateString}
|
{helpTranslateString}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -92,8 +92,8 @@ class Footer extends React.Component {
|
||||||
<a
|
<a
|
||||||
href="https://code.facebook.com/projects/"
|
href="https://code.facebook.com/projects/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
className="fbOpenSource"
|
rel="noreferrer noopener"
|
||||||
>
|
className="fbOpenSource">
|
||||||
<img
|
<img
|
||||||
src={`${this.props.config.baseUrl}img/oss_logo.png`}
|
src={`${this.props.config.baseUrl}img/oss_logo.png`}
|
||||||
alt="Facebook Open Source"
|
alt="Facebook Open Source"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue