CKEDITOR.styleSet.add - new style for 'a' element

寵の児 提交于 2019-12-01 09:08:09

问题


For some reason if I change 'p' to 'a', it no longer appears on the style list. Any reason why?

CKEDITOR.stylesSet.add('default',[ 
        { name : 'Wys wiersza 1' , 
          element : 'p', 
          styles : { 'line-height' : '18px' } 
         }
]);

-edited the code, I missed some brackets while copying


回答1:


Your problem is a bracket mess. This code will work:

CKEDITOR.stylesSet.add( 'default',
    [
        {
            name: 'Wys wiersza 1' ,
            element: 'p',
            styles: { 'line-height' : '18px' }
        }
    ]
);

EDIT: Now I see it's a CKEditor bug as it only fails for element: 'a'. Created ticket for this: https://dev.ckeditor.com/ticket/9349



来源:https://stackoverflow.com/questions/12463945/ckeditor-styleset-add-new-style-for-a-element

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