TinyMCE 添加项目符号时,项目符号不会显示在前端/视图中 [英] TinyMCE when adding bullets the bullets do not show in front end/view

查看:42
本文介绍了TinyMCE 添加项目符号时,项目符号不会显示在前端/视图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,项目符号会自动隐藏在列表元素中

I have a website where bullets are automatically hidden in list elements

<ul>
<li>aSASa</li>
<li>ASDDAS</li>
<li>SADASD</li>
</ul>

现在我想知道是否有可能在使用 TinyMCE 添加项目符号时自动将内联样式的类添加到列表元素,使项目符号能够显示,例如.

Now I wonder if it's possible when adding a bullet using TinyMCE to automatically add a class on inline style to the list element that will enable bullts to show eg.

代替只添加

    timnymce 应该添加

      insteas of just adding <ul> timnymce should add <ul style="list-style-type:circle;">

      推荐答案

      是的,这是可能的.您需要弄清楚您将在什么事件上执行以下操作(使用 setup tinymce init 参数或自己的插件):

      Yes this is possible. You will need to figure out on what event you will do the following action (either using the setup tinymce init parameter or an own plugin):

      $(editor.getBody()).find('ul').css('list-style-type','circle');
      

      示例使用设置参数和 onKeyUp 事件:

      Example using the setup parameter and the onKeyUp event:

        setup : function(ed) {
          ed.onKeyUp.add(function(ed, evt) {
               $(ed.getBody()).find('ul').css('list-style-type','circle');
          });
        },
      

      这篇关于TinyMCE 添加项目符号时,项目符号不会显示在前端/视图中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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