Twitter bootstrap 带下标和上标的引导wysithml5

Twitter bootstrap 带下标和上标的引导wysithml5,twitter-bootstrap,wysihtml5,Twitter Bootstrap,Wysihtml5,对于我的引导网站,我想使用。但是,默认情况下,它不支持super-/subscript 我为编辑器添加的这一行: <a class='btn' data-wysihtml5-command='superscript'>superscript</a> 以下代码是wysihtml5引导编辑器源代码的一部分: dom.delegatecontainer,[data-wysihtml5-command],单击,functionevent{ var link=这个, comman

对于我的引导网站,我想使用。但是,默认情况下,它不支持super-/subscript

我为编辑器添加的这一行:

<a class='btn' data-wysihtml5-command='superscript'>superscript</a>
以下代码是wysihtml5引导编辑器源代码的一部分:

dom.delegatecontainer,[data-wysihtml5-command],单击,functionevent{ var link=这个, command=link.getAttributedata-wysihtml5-command, commandValue=link.getAttributedata-wysihtml5-command-value; that.execCommandcommand,commandValue; 违约事件; };

默认情况下,它适用于所有内容,但不适用于上标和下标

谷歌给我的结果是,我必须使用execCommand,commandValue设置为false,但这也不起作用


有人确实知道如何让它工作,它会添加/到代码中?

尝试SUP而不是SUPERSCRIPT

尝试SUP而不是SUPERSCRIPT

将以下代码添加到源代码中

使用sup和sub修改所见即所得HTM5

在源的第6876行之后

(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sub = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sub");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sub");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sup = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sup");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sup");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
    "sub":    "sub",
    "sup":    "sup"
    "83": "sub", // S
    "80": "sup" // P
在源的第8441行之后

(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sub = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sub");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sub");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sup = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sup");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sup");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
    "sub":    "sub",
    "sup":    "sup"
    "83": "sub", // S
    "80": "sup" // P

将以下代码添加到源代码中

使用sup和sub修改所见即所得HTM5

在源的第6876行之后

(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sub = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sub");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sub");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sup = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sup");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sup");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
    "sub":    "sub",
    "sup":    "sup"
    "83": "sub", // S
    "80": "sup" // P
在源的第8441行之后

(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sub = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sub");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sub");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
(function (wysihtml5) {
    var undef;

    wysihtml5.commands.sup = {
        exec: function (composer, command) {
            return wysihtml5.commands.formatInline.exec(composer, command, "sup");
        },

        state: function (composer, command, color) {
            // element.ownerDocument.queryCommandState("bold") results:
            // firefox: only <b>
            // chrome:  <b>, <strong>, <h1>, <h2>, ...
            // ie:      <b>, <strong>
            // opera:   <b>, <strong>
            return wysihtml5.commands.formatInline.state(composer, command, "sup");
        },

        value: function () {
            return undef;
        }
    };
})(wysihtml5);
    "sub":    "sub",
    "sup":    "sup"
    "83": "sub", // S
    "80": "sup" // P

我想扩展上述示例,您应该在parserRules的bootstrap-wysihtml5.js中添加以下内容:

tags: {
                "sub":{},
                "sup":{}..

我想扩展上述示例,您应该在parserRules的bootstrap-wysihtml5.js中添加以下内容:

tags: {
                "sub":{},
                "sup":{}..