This is a migrated thread and some comments may be shown as answers.

[Solved] Rad Editor does not generate XHTML

1 Answer 49 Views
RadEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mayerh2
Top achievements
Rank 1
mayerh2 asked on 23 Jul 2007, 07:42 PM
There are cases, where RadEditor does not generate XHTML -> i.e. attribute values of html elements are not in quotes - They are not there in MOSS Display Mode, in Editing Mode they are there. (  <property name="ConvertToXhtml">True</property> is set)
Tested with Rad Editor for MOSS Full (Trial Version, 7.1.1)

1. Case: We have the following Snippet definition in ToolsFile.xml:
   </snippet>
   <snippet name="List next">
 <![CDATA[
   <div class="list next">
     <p class="list-introduction">Introduction</p>
     <ul class="bullet">
       <li>First</li>
    <li>Second</li>
   </ul>
  </div>
 ]]>
In Display Mode we get (missing qoutes e. g in case of attribute class):
  <div class=list>
    <p class=list-introduction>Introduction</p>
    <ul class=bullet>
      <li style="padding-right:0px;background-position:4px 6px;padding-left:18px;padding-bottom:0px;padding-top:0px">First</li>
      <li style="padding-right:0px;background-position:4px 8px;padding-left:18px;padding-bottom:0px;padding-top:2px">Second</li>
    </ul>
  </div>

2.Case -> MOSSLinkManager:
The generated link misses quotes for attribute values in Display Mode:
<a class=link4design id=bookmark title=TestTooltip href="/sites/siemens1/en/corp/Pages/simple1.aspx">TestLink</a>
(Attribute values are set in AssetPickers.s AnchorHtmlElement)

Thank you for help,

Hugo

1 Answer, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 24 Jul 2007, 10:23 AM
Hello Hugo,

1. We did some research with the current editor beta version (7.1.3). We tried to make the HTML output XHTML compliant as much as possible and here is what we discovered:

The editor was given the same content in all cases and then we compared it with what was displayed when viewing the content (presentation mode). Here is the content:

<div class="list next">
    <p class="list-introduction">Introduction</p>
    <ul class="bullet">
        <li>First</li>
        <li>Second</li>
    </ul>
</div>

a) list scenario (announcements list). Displayed HTML is the following (The same output is produced with the default HTML editor):

<div class="list next">
    <p class=list-introduction>Introduction</p>
    <ul class=bullet>
        <li>First</li>
        <li>Second</li>
    </ul>
</div>

As you can see, some tags keep the quotes in their attributes, others do not. The change happens after the editor content is submitted so we have no control over it.

b) Web Part RadEditor:

Here the output matches the editor submitted content:

<div class="list next">
    <p class="list-introduction">Introduction</p>
    <ul class="bullet">
        <li>First</li>
        <li>Second</li>
    </ul>
</div>

You should have no problems with XHTML in the RadEditor web part.

c) WCM publishing html field. Output was identical to the list scenario. the <div> element kept its quotes on the class attribute, while the <p> element lost them. We suspect that there is a server-side SharePoint filter, which affects the editor submitted content. We have had similar problems with flash and media content - SharePoint strips the <embed> and <object> tags from the editor content. Again the problem was not present in the Web Part.

Unfortunately, we have not yet found a way to fix this as we have no control over what SharePoint does with the content.

2. We observed similar behavior with the links. Here is the output from a simple link:

<a id=test title="test wp" href="/Pages/testwebpart.aspx">Test link</a>

As you can see - some attributes have quotes (title, href), while others do not (id). We have traced the editor content from the browser and on the server and it was OK (had quotes on all attributes). However, as I said earlier, we have no control over the content once it leaves the editor and also we observed the same behavior with the default SharePoint html editor.

Regards,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
RadEditor
Asked by
mayerh2
Top achievements
Rank 1
Answers by
Lini
Telerik team
Share this question
or