首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >TYPO3 9.5.4 CKEditor RTE删除样式属性

TYPO3 9.5.4 CKEditor RTE删除样式属性
EN

Stack Overflow用户
提问于 2019-04-18 15:52:57
回答 1查看 1.4K关注 0票数 2

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

带有内容的So和old元素:

代码语言:javascript
运行
复制
<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>
....

在编辑器中加载为:

代码语言:javascript
运行
复制
<table class="centertable" style="height:655px; width:972px">   
<tbody>     
    <tr>    
        <td>        
    <p>&nbsp;</p>
...

因此,当你保存你丢失你的风格信息。我尝试了以下TypoScript:

代码语言:javascript
运行
复制
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就能解决这个问题?

提前感谢您的帮助。

EN

回答 1

Stack Overflow用户

发布于 2019-04-18 16:07:44

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

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

代码语言:javascript
运行
复制
processing:
    allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop]

您可以提供自己的配置,例如this guide;我会尝试使用

代码语言:javascript
运行
复制
processing:
    allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop, style]
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55741464

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档