1 Star 0 Fork 135

hzhlu/docsify

forked from docsifyjs/docsify 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
external-script.js 675 Bytes
一键复制 编辑 原始数据 按行查看 历史
function handleExternalScript() {
const container = Docsify.dom.getNode('#main');
const scripts = Docsify.dom.findAll(container, 'script');
for (const script of scripts) {
if (script.src) {
const newScript = document.createElement('script');
Array.from(script.attributes).forEach(attribute => {
newScript[attribute.name] = attribute.value;
});
script.parentNode.insertBefore(newScript, script);
script.parentNode.removeChild(script);
}
}
}
const install = function (hook) {
hook.doneEach(handleExternalScript);
};
window.$docsify = window.$docsify || {};
$docsify.plugins = [install, ...($docsify.plugins || [])];
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/hzhlu/docsify.git
git@gitee.com:hzhlu/docsify.git
hzhlu
docsify
docsify
develop

搜索帮助