TYPO3 9.5.4 CKEditor RTE删除样式属性

问题描述 投票:1回答:1

我从7-> 8-> 9更新了TYPO3网站。现在的问题是RTE CKEditor不断删除样式属性甚至样式。

所以和旧元素的内容:

<div class="mobilr">
<table height="655" width="972" style="vertical-align: middle; background-color: rgb(255, 255, 255); border-style: solid; border-color: rgb(187, 187, 187);" class="centertable">
<tbody>
<tr style="vertical-align: middle;">
<td>
<p>&nbsp;</p>
....

在编辑器中加载为:

<table class="centertable" style="height:655px; width:972px">   
<tbody>     
    <tr>    
        <td>        
    <p>&nbsp;</p>
...

所以当你保存你的风格信息时。我尝试了以下TypoScript:

RTE.default.proc.allowedClasses = centertable, mobilr
RTE.default.proc.allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, strong, em, b, i, u, sub, sup, a, img, hr, abbr, acronym, cente
RTE.default.proc.keepPDIVattribs := addToList(style)
RTE.default.proc.entryHTMLparser_db.tags.p.allowedAttribs = class, align, style
RTE.default.proc.entryHTMLparser_db.tags.td.allowedAttribs = class, align, style
RTE.default.proc.entryHTMLparser_db.tags.tr.allowedAttribs = class, align, style
RTE.default.proc.entryHTMLparser_db.tags.table.allowedAttribs = class, align, style
RTE.default.proc.entryHTMLparser_db.tags.div.allowedAttribs = class, align, style
RTE.default.proc.entryHTMLparser_db.tags.h1.allowedAttribs = class, align, style
RTE.default.proc.entryHTMLparser_db.tags.h2.allowedAttribs = class, align, style

这可悲无济于事。我将代码放在我的设置和页面上。有没有办法完全关闭entryHTMLparser或另一个想法,以解决这个问题而不使用TS?

预先感谢您的帮助。

ckeditor typo3 typoscript rte typo3-9.x
1个回答
2
投票

这可能是.yaml文件中的配置;我看到了

EXT:rte_ckeditor /配置/ RTE / Processing.yaml:

processing:
    allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop]

您可以提供以下自己的配置,例如this guide;我试试

processing:
    allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop, style]
© www.soinside.com 2019 - 2024. All rights reserved.