TYPO3 9.5.4 CKEditor RTE删除样式属性 [英] TYPO3 9.5.4 CKEditor RTE deletes style attributes

查看:78
本文介绍了TYPO3 9.5.4 CKEditor RTE删除样式属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I updated a TYPO3 website from 7->8->9. Now the problem is that the RTE CKEditor keeps deleting style attributes and even styles.

具有内容的旧元素

<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>
....

在编辑器中的加载方式为:

is loaded in the editor as:

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

因此,保存时会丢失样式信息.我尝试了以下TypoScript:

So when you save you loose your style information. I tried the following 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来解决此问题的另一种方法?

This sadly has no effect. I placed the code in my setup and on the page. Is there a way to completely shut down the entryHTMLparser or another idea to solve this without using TS?

预先感谢您的帮助.

推荐答案

这可能是.yaml文件中的配置;我在

That could be the configuration in the .yaml files; I see in the

EXT:rte_ckeditor/Configuration/RTE/Processing.yaml:

EXT:rte_ckeditor/Configuration/RTE/Processing.yaml:

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

您可以按照例如本指南;我会尝试

You can provide your own configuration following for example this guide; I'd try with

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

这篇关于TYPO3 9.5.4 CKEditor RTE删除样式属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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