这听起来像是应该提交给 SDL 客户支持的错误。IE、Chrome 和 FF 的行为是否不同?
除非支持可以提供热修复,否则我认为您唯一的选择是使用过滤 XSLT 过滤掉单独的 BR(如 Frank 建议的那样)。创建新富文本字段时使用的默认 XSLT 过滤器包含此过滤,如下所示(最后一个<template>
节点)。
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></output>
<template match="/ | node() | @*">
<copy>
<apply-templates select="node() | @*"></apply-templates>
</copy>
</template>
<template match="*[ (self::br or self::p or self::div) and normalize-space(translate(., ' ', '')) = '' and not(@*) and not(processing-instruction()) and not(comment()) and not(*[not(self::br) or @* or * or node()]) and not(following::node()[not( (self::text() or self::br or self::p or self::div) and normalize-space(translate(., ' ', '')) = '' and not(@*) and not(processing-instruction()) and not(comment()) and not(*[not(self::br) or @* or * or node()]) )]) ]">
<!-- ignore all paragraphs and line-breaks at the end that have nothing but (non-breaking) spaces and line breaks -->
</template>
<template match="br[parent::div and not(preceding-sibling::node()) and not(following-sibling::node())]">
<!-- Chrome generates <div><br/></div>. Renders differently in different browsers. Replace it with a non-breaking space -->
<text> </text>
</template>
</stylesheet>