Skip to content

Commit

Permalink
fix: add rel="noopener" to anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
fodpeter authored and jessy1092 committed Aug 12, 2018
1 parent 4b4d965 commit 3bf9999
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const GitHubForkRibbon = ({position = 'right', href, target, color = 'red', clas
style={ribbonStyle}>
<a href={href}
target={target}
style={RibbonStyle.urlStyle}>
style={RibbonStyle.urlStyle}
rel="noopener">
{children}
</a>
</div>
Expand Down
11 changes: 11 additions & 0 deletions storybook/__tests__/__snapshots__/GithubForkRibbon.stories.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exports[`default with right position and red color 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -107,6 +108,7 @@ exports[`handle unexist color with default 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -172,6 +174,7 @@ exports[`handle unexist position with default 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -258,6 +261,7 @@ exports[`on left position 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -324,6 +328,7 @@ exports[`on left-bottom position 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -389,6 +394,7 @@ exports[`on right position 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -455,6 +461,7 @@ exports[`on right-bottom position 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -520,6 +527,7 @@ exports[`with black color 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -585,6 +593,7 @@ exports[`with green color 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -650,6 +659,7 @@ exports[`with orange color 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down Expand Up @@ -715,6 +725,7 @@ exports[`with red color 1`] = `
>
<a
href="//www.google.com"
rel="noopener"
style={
Object {
"borderColor": "rgba(255, 255, 255, 0.7)",
Expand Down

0 comments on commit 3bf9999

Please sign in to comment.