1

我试图查看文档,但没有解释例如如何更改粗体格式以在<strong>text</strong>tag 而不是<b>text</b>tag 之间换行?

var options = {
    modules: {
        placeholder: { text: attrs.rtePlaceholder, style: { color: '#A9A9A9' } }
    }
};
var quil = new Quill('#' + element.attr('id'), options);
var Normalizer = Quill.require('normalizer');
delete Normalizer.ALIASES["STRONG"];
Normalizer.ALIASES["B"] = "STRONG";
quil.addFormat('bold', { tag: 'STRONG', prepare: 'bold' });
4

1 回答 1

2

官方支持仍然即将到来,但这应该现在可以工作:

var Normalizer = Quill.require('normalizer');
delete Normalizer.ALIASES["STRONG"];
Normalizer.ALIASES["B"] = "STRONG";
quill.addFormat('bold', { tag: 'STRONG', prepare: 'bold' });
于 2015-05-08T19:47:04.703 回答