简体   繁体   中英

TinyMCE use <div align=“center”> instead of <div style=“text-align: center”>?

I am using TinyMCE 3.2.5 and by default when you click the center align button it uses an inline style <div style="text-align=center"> . I would like tinyMCE to use <div align="center"> instead of the inline style.

I know setting inline_styles: false in the configuration works. But I would like to use inline styles for everything but alignment.

How would I go about changing this?

tinyMCE.init({
        ...
        'formats' : {
        'alignleft' : {'selector' : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', attributes: {"align":  'left'}},
        'aligncenter' : {'selector' : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', attributes: {"align":  'center'}},
        'alignright' : {'selector' : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', attributes: {"align":  'right'}},
        'alignfull' : {'selector' : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', attributes: {"align":  'justify'}}
    }
})

编写自己的插件并根据需要设置对齐。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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