Skip to content

Commit

Permalink
解决 jsfiddle 标签插件在 https 下报非 https 的警告 (#2086)
Browse files Browse the repository at this point in the history
* 删除 jsfiddle 网址前面的 http 限制

* 删除 jsfiddle 的 test
  • Loading branch information
jerrybendy authored and NoahDragon committed Oct 20, 2016
1 parent ceee832 commit afe0bb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/tag/jsfiddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function jsfiddleTag(args, content) {
var width = args[3] && args[3] !== 'default' ? args[3] : '100%';
var height = args[4] && args[4] !== 'default' ? args[4] : '300';

return '<iframe scrolling="no" width="' + width + '" height="' + height + '" src="http://jsfiddle.net/' + id + '/embedded/' + tabs + '/' + skin + '" frameborder="0" allowfullscreen></iframe>';
return '<iframe scrolling="no" width="' + width + '" height="' + height + '" src="//jsfiddle.net/' + id + '/embedded/' + tabs + '/' + skin + '" frameborder="0" allowfullscreen></iframe>';
}

module.exports = jsfiddleTag;
10 changes: 5 additions & 5 deletions test/scripts/tags/jsfiddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ describe('jsfiddle', function() {
it('id', function() {
var $ = cheerio.load(jsfiddle(['foo']));

$('iframe').attr('src').should.eql('http://jsfiddle.net/foo/embedded/js,resources,html,css,result/light');
$('iframe').attr('src').should.eql('//jsfiddle.net/foo/embedded/js,resources,html,css,result/light');
});

it('tabs', function() {
var $ = cheerio.load(jsfiddle(['foo', 'default']));

$('iframe').attr('src').should.eql('http://jsfiddle.net/foo/embedded/js,resources,html,css,result/light');
$('iframe').attr('src').should.eql('//jsfiddle.net/foo/embedded/js,resources,html,css,result/light');

$ = cheerio.load(jsfiddle(['foo', 'html,css']));

$('iframe').attr('src').should.eql('http://jsfiddle.net/foo/embedded/html,css/light');
$('iframe').attr('src').should.eql('//jsfiddle.net/foo/embedded/html,css/light');
});

it('skin', function() {
var $ = cheerio.load(jsfiddle(['foo', 'default', 'default']));

$('iframe').attr('src').should.eql('http://jsfiddle.net/foo/embedded/js,resources,html,css,result/light');
$('iframe').attr('src').should.eql('//jsfiddle.net/foo/embedded/js,resources,html,css,result/light');

$ = cheerio.load(jsfiddle(['foo', 'default', 'dark']));

$('iframe').attr('src').should.eql('http://jsfiddle.net/foo/embedded/js,resources,html,css,result/dark');
$('iframe').attr('src').should.eql('//jsfiddle.net/foo/embedded/js,resources,html,css,result/dark');
});

it('width', function() {
Expand Down

0 comments on commit afe0bb1

Please sign in to comment.