下面的代碼添加到源https://github.com/xing/wysihtml5/blob/master/dist/wysihtml5-0.3.0.js
改性wysihtm5與SUP和子
從源
(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);
和後線6876後來自源的7291行
"sub": "sub",
"sup": "sup"
和從源極線8441後
"83": "sub", // S
"80": "sup" // P