I have a component with a rich text field.
In the Source tab I type the bellow html source to the rich text field.
<a><span>test<span></a>
then I switch to the Design tab and then I switch to the Source tab and My typing html source is not change.(This behavior is my desire.)
<a><span>test<span></a>
But, next
In the Source tab I type the bellow html source to the rich text field.
<a><div>test</div></a>
then I switch to the Design tab and then I switch to the Source tab and My typing html source is change.
<a> </a>
<div>test</div>
But I want to not change HTML Structure.
The configuration of rich text field is described below.
Document Type: Transitional
Accessibility Level: None
Filtering XSLT is described below.(default)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></xsl:output>
<xsl:template match="/ | node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl: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 -->
</xsl:template>
<xsl: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 -->
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
I think that the above Filtering XSLT configuration is wrong, maybe.
But I don't know where is wrong.
So, please tell me how to configurate the Filtering XSLT and limitation of rich text field (for example, <head>
tag can not be used. )
XML
in theXHTML
namespace" (XHTML
in practice). So we can't put a<div>
inside ana
or anchor by default. Consider aspan
or changing the configuration (see KB post or Nick's post). For a product perspective, see Nuno's post.