From 8c7e80b0bc0a1fa85e9648bf083b65ad5a9e5e34 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 6 Oct 2020 11:44:49 -0700 Subject: [PATCH 1/2] Just enforce that all links open in a new tab for now --- src/components/AnchorForCommentsOnly/index.js | 14 ++------------ src/page/home/report/ReportActionItemFragment.js | 2 -- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/index.js index 96244d3472789..8079d5b327597 100644 --- a/src/components/AnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/index.js @@ -10,12 +10,6 @@ const propTypes = { // The URL to open href: PropTypes.string, - // What headers to send to the linked page (usually noopener and noreferrer) - rel: PropTypes.string, - - // Used to determine where to open a link ("_blank" is passed for a new tab) - target: PropTypes.string, - // Any children to display children: PropTypes.node, @@ -26,16 +20,12 @@ const propTypes = { const defaultProps = { href: '', - rel: '', - target: '', children: null, style: {}, }; const AnchorForCommentsOnly = ({ href, - rel, - target, children, style, ...props @@ -43,8 +33,8 @@ const AnchorForCommentsOnly = ({ diff --git a/src/page/home/report/ReportActionItemFragment.js b/src/page/home/report/ReportActionItemFragment.js index 54954d68cc40c..37ccc5e8ab9d7 100644 --- a/src/page/home/report/ReportActionItemFragment.js +++ b/src/page/home/report/ReportActionItemFragment.js @@ -35,8 +35,6 @@ class ReportActionItemFragment extends React.PureComponent { a: (htmlAttribs, children, convertedCSSStyles, passProps) => ( From 308a558d7a7a68dbb122cd9a0890dc2e56aa3542 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 6 Oct 2020 11:58:40 -0700 Subject: [PATCH 2/2] Default to target blank and noopener noreferrer --- src/components/AnchorForCommentsOnly/index.js | 14 ++++++++++++-- src/page/home/report/ReportActionItemFragment.js | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/index.js index 8079d5b327597..96244d3472789 100644 --- a/src/components/AnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/index.js @@ -10,6 +10,12 @@ const propTypes = { // The URL to open href: PropTypes.string, + // What headers to send to the linked page (usually noopener and noreferrer) + rel: PropTypes.string, + + // Used to determine where to open a link ("_blank" is passed for a new tab) + target: PropTypes.string, + // Any children to display children: PropTypes.node, @@ -20,12 +26,16 @@ const propTypes = { const defaultProps = { href: '', + rel: '', + target: '', children: null, style: {}, }; const AnchorForCommentsOnly = ({ href, + rel, + target, children, style, ...props @@ -33,8 +43,8 @@ const AnchorForCommentsOnly = ({ diff --git a/src/page/home/report/ReportActionItemFragment.js b/src/page/home/report/ReportActionItemFragment.js index 37ccc5e8ab9d7..a7af5f15635cf 100644 --- a/src/page/home/report/ReportActionItemFragment.js +++ b/src/page/home/report/ReportActionItemFragment.js @@ -35,6 +35,13 @@ class ReportActionItemFragment extends React.PureComponent { a: (htmlAttribs, children, convertedCSSStyles, passProps) => (