In a Rich Text Field of a Component I add in some text for e.g. "This is my first line. This will be my second line.". I then hit Enter after "line.".
At this point when I view the source, I see the following:
<p>This is my first line. </p> <p>This will be my second line.</p>
However, now I go back into the design tab and click backspace to essentially have all the text in one line and this is how my source becomes:
<p>This is my first line. <span style="font-size: 12px; font-family: Verdana;">This will be my second line.</span></p>
Where are these
span tags coming from? How can I remove them to just keep the
p tags? We are using Tridion 2011 SP1. Also, if it helps at all, I have tried replicating the same issue on another Tridion environment and this doesn't happen. So I believe this is a configuration thing, but don't really know where to start.
The XSLT for one of the Schema fields is shown below.
<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>
There are other RTFs that have the same issue too.
I have also looked at the XSLTs in the following location
\TRIDION_HOME\Program Files (x86)\Tridion\web\WebUI\Core\Controls\FormatArea\XSLTs. I've compared these to working versions and both sets are identical.
Further to Robs comment, I have tested this across different browsers and can confirm this only happens in Chrome - all other browsers are fine.