In the SDL Tridion 2011 content management system, when editing a component in a rich text field (RTF) I noticed pressing enter results in different HTML tags in the source.
I think it's based on browser since I get <div> with Chrome. How do I make sure I get <p> tags in all browsers?
Update:
SDL Tridion 2011 SP1 has the following in the default XSLT schema rich text filter, which appears to fix the scenario of pressing enter when editing regular Body Text or paragraphs. I still have the issue when pressing enter after a heading, which comes out as a div in Chrome.
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<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>
Updated question then is:
How do I make sure I get <p> tags in all browsers, even when pressing enter after a heading?