Skip to content

Commit 01190b0

Browse files
committed
fix: use external noopener as rel
1 parent 45a5f56 commit 01190b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/plugins/helper/link_to.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function linkToHelper(path, text, options) {
2323

2424
if (attrs.external) {
2525
attrs.target = '_blank';
26-
attrs.rel = 'noopener';
26+
attrs.rel = 'external noopener';
2727
attrs.external = null;
2828
}
2929

test/scripts/helpers/link_to.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ describe('link_to', () => {
2222

2323
it('external (boolean)', () => {
2424
linkTo('http://hexo.io/', 'Hexo', true)
25-
.should.eql('<a href="http://hexo.io/" title="Hexo" target="_blank" rel="external">Hexo</a>');
25+
.should.eql('<a href="http://hexo.io/" title="Hexo" target="_blank" rel="external noopener">Hexo</a>');
2626
});
2727

2828
it('external (object)', () => {
2929
linkTo('http://hexo.io/', 'Hexo', {external: true})
30-
.should.eql('<a href="http://hexo.io/" title="Hexo" target="_blank" rel="external">Hexo</a>');
30+
.should.eql('<a href="http://hexo.io/" title="Hexo" target="_blank" rel="external noopener">Hexo</a>');
3131
});
3232

3333
it('class (string)', () => {

0 commit comments

Comments
 (0)