我从7->8->9更新了一个TYPO3网站,现在的问题是RTE CKEditor一直在删除样式属性甚至样式。
带有内容的So和old元素:
<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> </p>
....
在编辑器中加载为:
<table class="centertable" style="height:655px; width:972px">
<tbody>
<tr>
<td>
<p> </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就能解决这个问题?
提前感谢您的帮助。
发布于 2019-04-18 08:07:44
这可能是.yaml文件中的配置;我在
EXT:rte_ckeditor/Configuration/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]
https://stackoverflow.com/questions/55741464
复制相似问题