我正在尝试删除自动添加<p>
CQ5(版本5.6.0.20130125)中的标签。我尝试将这些属性添加到文本组件 http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.form.RichText我正在使用但是没有效果。(source http://forums.adobe.com/message/4908946#4908946)
removeSingleParagraphContainer true
singeParagraphContainerReplacement (empty string)
我也尝试过这个解决方案 https://stackoverflow.com/questions/13798280/cq5-rich-text-editor-htmlrules-doctype-node-being-ignored。再次,没有效果。
是否可以禁用自动添加<p>
tag?
感谢您的任何想法
EDIT我试过了这个答案 https://stackoverflow.com/a/17968732/2022162但CQ仍然添加<p>
标记到我的代码。例如,我有这个 HTML 代码
<strong>Headquarters:</strong>
<p>MY - COMPANY a.s.<br>
Random Street 77<br>
Random City</p>
提交后,代码更改为
<p><strong>Headquarters:</strong></p>
<p>MY - COMPANY a.s.<br>
Random Street 77<br>
Random City</p>
我的 RTE 看起来像这样
<text jcr:primaryType="cq:widget"
hideLabel="{Boolean}true"
name="./text"
xtype="richtext">
<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
...
</docType>
<blockHandling
jcr:primaryType="nt:unstructured"
removeSingleParagraphContainer="{Boolean}true"/>
</htmlRules>
</text>
EDIT2 this is what my hierarchy looks like
您可以使用以下命令阻止 RTE 包围您的文本<p>
标签通过设置removeSingleParagraphContainer
财产给true
只要您只创建一个段落。
With Chrome on Mac OS X (at least), holding shift while pressing enter inserts line breaks instead of paragraph breaks so you can still create text with multiple lines. Since you said in your last question https://stackoverflow.com/questions/17946117/strong-tag-getting-replaced-to-b-tag-in-cq5 that you're using the misctools
plugin, you can use the source edit view to peek at the markup as you go.
最后,要设置removeSingleParagraphContainer
属性,您需要创建另一个名为blockHandling
在你的htmlRules
对话框中的节点。你不需要乱搞singeParagraphContainerReplacement
属性,但如果这样做,您将把它设置在同一个节点上:
<rtePlugins jcr:primaryType="nt:unstructured">
...
</rtePlugins>
<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
...
</docType>
<blockHandling
jcr:primaryType="nt:unstructured"
removeSingleParagraphContainer="{Boolean}true"/>
</htmlRules>
编辑有关您的编辑:使用源编辑功能misctools
插件并粘贴这个确切的文本可以保存和加载,而无需p
Mac OS X 上的 Chrome 中的标签:
<strong>Headquarters:</strong><br>
MY - COMPANY a.s.<br>
Random Street 77<br>
Random City
您确定dialog.xml部署正确吗?也许仔细检查组件的对话框层次结构是否符合您在 CRXDE Lite 中的预期:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)