Skip to content

Commit

Permalink
#441 - fixed issue with rel attribute for links in the post editor
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed May 11, 2019
1 parent 988e83e commit 9e6b868
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/back-end/builddata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"0.34.0","build":11730,"status":"Beta"}
{"version":"0.34.0","build":11733,"status":"Beta"}
6 changes: 6 additions & 0 deletions app/src/components/post-editor/InlineEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export default {
if (response.rel) {
relAttr = ' rel="nofollow"';
if (response.target.indexOf('_blank') > -1) {
relAttr = ' rel="nofollow noopener noreferrer"';
}
} else if (response.target.indexOf('_blank') > -1) {
relAttr = ' rel="noopener noreferrer"';
}
let linkHTML = `<a href="${response.url}"${response.title}${response.target}${relAttr}>${response.text}</a>`;
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/post-editor/LinkPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default {
}
}
if (relContent && relContent[1]) {
if (relContent && relContent[1].indexOf('nofollow') > -1) {
this.rel = true;
}
},
Expand Down
6 changes: 6 additions & 0 deletions app/src/components/post-editor/LinkToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export default {
if (response.rel) {
relAttr = ' rel="nofollow"';
if (response.target.indexOf('_blank') > -1) {
relAttr = ' rel="nofollow noopener noreferrer"';
}
} else if (response.target.indexOf('_blank') > -1) {
relAttr = ' rel="noopener noreferrer"';
}
let linkHTML = `<a href="${response.url}"${response.title}${response.target}${relAttr}>${response.text}</a>`;
Expand Down

0 comments on commit 9e6b868

Please sign in to comment.