TinyMCE when adding bullets the bullets do not show in front end/view

徘徊边缘 提交于 2019-12-13 16:12:52

问题


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

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

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.

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


回答1:


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');

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');
    });
  },


来源:https://stackoverflow.com/questions/7986473/tinymce-when-adding-bullets-the-bullets-do-not-show-in-front-end-view

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!