CQ5 Rich Text Editor HtmlRules DocType node being ignored

谁都会走 提交于 2019-12-24 07:59:27

问题


The widget API suggests that you can change the default wrapping tag for the rich text editor content via the DocType object on the HtmlRules object under a rich text editor:

defaultEditBlock : String The default edit block type to use; defaults to "p" Added in CQ 5.4.

I need to change this so that I can include the content of a rich text editor field within a p tag which has a particular class (you cannot put one p tag inside another so the automatic wrapping breaks out of my predefined p tag).

Unfortunatly it would seem that this node is being ignored.

What do I need to do to remove the p tags or if not that then change them to something that would go inside a p tag?

The following is the xml for the rich text editor, the rtePlugins node seems to work correctly but not the htmlRules node.

<introText
     jcr:primaryType="cq:Widget"
     allowBlank="{Boolean}false"
     fieldLabel="Intro text"
     name="./introText"
     xtype="richtext">
     <htmlRules jcr:primaryType="nt:unstructured">
         <docType jcr:primaryType="nt:unstructured"
                  defaultEditBlock="span">
         </docType>
  </htmlRules>
  <rtePlugins jcr:primaryType="nt:unstructured">
        <edit jcr:primaryType="nt:unstructured"
              features="[cut,copy,paste-default,paste-plaintext]"/>
        <format jcr:primaryType="nt:unstructured"
               features="[]"/>
        <justify jcr:primaryType="nt:unstructured"
                 features="[]"/>
        <lists jcr:primaryType="nt:unstructured"
               features="[]"/>
    </rtePlugins>
</introText>

来源:https://stackoverflow.com/questions/13798280/cq5-rich-text-editor-htmlrules-doctype-node-being-ignored

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!