fix: improve external script plugin (#632)
This commit is contained in:
parent
1897bb6af0
commit
50c2434ab5
2 changed files with 2 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ function handleExternalScript() {
|
|||
var newScript = document.createElement('script');
|
||||
|
||||
Array.prototype.slice.call(script.attributes).forEach(function (attribute) {
|
||||
newScript[attribute.name] = attribute.value;
|
||||
newScript.setAttribute(attribute.name, attribute.value);
|
||||
});
|
||||
|
||||
script.parentNode.insertBefore(newScript, script);
|
||||
|
|
|
|||
2
lib/plugins/external-script.min.js
vendored
2
lib/plugins/external-script.min.js
vendored
|
|
@ -1 +1 @@
|
|||
!function(){function o(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(e){e.doneEach(o)},window.$docsify.plugins)}();
|
||||
!function(){function o(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t.setAttribute(o.name, o.value),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(e){e.doneEach(o)},window.$docsify.plugins)}();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue