Skip to content

Commit

Permalink
bump: 3.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Apr 25, 2017
1 parent 11c94b2 commit a5f6ccd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/plugins/external-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ function handleExternalScript () {
var container = Docsify.dom.getNode('#main');
var scripts = Docsify.dom.findAll(container, 'script');

var loop = function ( i ) {
for (var i = scripts.length; i--;) {
var script = scripts[i];

if (script && script.src) {
var newScript = document.createElement('script');['src', 'async', 'defer'].forEach(function (attribute) {
newScript[attribute] = script[attribute];
var newScript = document.createElement('script');

Array.prototype.slice.call(script.attributes).forEach(function (attribute) {
newScript[attribute.name] = attribute.value;
});

script.parentNode.insertBefore(newScript, script);
script.parentNode.removeChild(script);
}
};

for (var i = scripts.length; i--;) loop( i );
}
}

var install = function (hook) {
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/external-script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5f6ccd

Please sign in to comment.