WebUI/AchieveManageWeb/kindeditor-4.1.3/plugins/clearhtml/clearhtml.js

(完整代码) 1KB

/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net
*
* @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
*******************************************************************************/

KindEditor.plugin('clearhtml', function (K) {
    var self = this, name = 'clearhtml';
    self.clickToolbar(name, function () {
        self.focus();
        var html = self.html();
        html = html.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/ig, '');
        html = html.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/ig, '');
        html = K.formatHtml(html, {
            a: ['href', 'target'],
            embed: ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
            img: ['src', 'width', 'height', 'border', 'alt', 'title', '.width', '.height'],
            table: ['border'],
            'td,th': ['rowspan', 'colspan'],
            'div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6': []
        });
        self.html(html);
        self.cmd.selection(true);
        self.addBookmark();
    });
});

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。