我可以在编辑器中自定义标题标签(h1,h2,h3 ...)吗? [英] Can I customise the header tags(h1,h2,h3...) in redactor editor?

查看:766
本文介绍了我可以在编辑器中自定义标题标签(h1,h2,h3 ...)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用redactor编辑器的插件来更改文本的字体大小和字体颜色。它在其他标签除了标题工作正常。不明白为什么。

I've used the plugins of redactor editor to change the font size and font color of text. It's working fine in other tags except the header. Don't understand why..

我试过了

$('#redactor').redactor({
    focus: true,
    plugins: ['fontcolor', 'fontsize'],
    formatting: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
});

任何帮助?

推荐答案

如果你的意思是这样用户可以改变标题的字体颜色,那么基本上你不能。我问他们为什么,他们回复了

If you mean so users can change the font color of headings then basically you can't. I asked why and they replied

这是通过设计完成的;标题样式应该是CSS
https://twitter.com/imperavi/status/575696417240391681

"it is done so by design; heading styles should be in CSS" https://twitter.com/imperavi/status/575696417240391681

我不得不修改redactor.js到最后并注释掉行4250,使其工作(如下所示):

I had to modify redactor.js in the end and comment out line 4250 to make it work (as it used to):

// Stop formatting pre and headers
// if (this.utils.isCurrentOrParent('PRE') || his.utils.isCurrentOrParentHeader()) return;

这篇关于我可以在编辑器中自定义标题标签(h1,h2,h3 ...)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆