简体   繁体   English

CKEditor 4中的自定义BBCode标签

[英]Custom BBCode Tags in CKEditor 4

Do anyone here know how to add custom BBCode tags to CKEditor 4? 这里有人知道如何将自定义BBCode标签添加到CKEditor 4吗? I have tried to look at ckeditor.js, but I can't seem to find the right part to edit. 我尝试查看ckeditor.js,但似乎找不到合适的部分进行编辑。

Actually, I just have to change the align buttons to output [left], [right] and [center] tags instead of: 实际上,我只需要更改align按钮以输出[left],[right]和[center]标签,而不是:

<div style="text-align: left">{TEXT_HERE}</div>

I have already tried to find it on Google, but everything I found was for older versions of CKEditor and/or the BBCode plugin. 我已经尝试在Google上找到它,但是我发现的所有内容都是针对较旧版本的CKEditor和/或BBCode插件的。

Any help is appreciated! 任何帮助表示赞赏!

I assume you want to edit this plugin: http://ckeditor.com/addon/bbcode 我假设您要编辑此插件: http : //ckeditor.com/addon/bbcode

You just simply need to the 'div' tag to bbcodeMap and tagnameMap to be converted (and not rewritten to p tag). 您只需要将“ div”标签转换为bbcodeMap和tagnameMap(而不是重写为p标签)即可。 Another stap is to edit stylesMap by adding align: 'text-align'. 另一个步骤是通过添加align:'text-align'来编辑stylesMap。

That shoudl work. 那个工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM