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

XHTML 1.0 Strict

1 Answer 70 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 04 Sep 2008, 01:20 PM
Hi,

my website is xhtml 1.0 strict compliant, but the editor produces invalid xhtml.
For example:
I type a text like "text" in the editor window. Afterwards I select the text and click auf "center". The produced xhtml code:
<p align="center">text</p>
But in xhtml 1.0 strict is the attribute align not allowed. The correct xhtml 1.0 strict code:
<p style="text-align: center">text</p>

How can I solve this problem?

Thomas

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Sep 2008, 03:28 PM
Hi Thomas,

Thank you for your feedback. I logged your request in our ToDo list and we will do our best to implement the requested functionality for the Q3 release of RadEditor.

Currently, you can achieve this functionality, but overriding the Justify commands of RadEditor, e.g.

<script type="text/javascript">
var editor;
function OnClientCommandExecuting(sender, args)
{
   var command = args.get_commandName();
   editor = sender;
   if (command == "JustifyLeft")
   {
        SetAlignment(editor, "left");
        args.set_cancel(true);
   }
   else if (command == "JustifyRight")
   {
        SetAlignment(editor, "right");
        args.set_cancel(true);
   }
   else if (command == "JustifyCenter")
   {
        SetAlignment(editor, "center");
        args.set_cancel(true);
   }
  
   function SetAlignment(editor, align)
   {
       var sel = editor.getSelectionHtml();
       editor.pasteHtml("<div style=text-align:" + align + " >" + sel  + "</div>" );
     
   }
}
</script>
 
<telerik:RadEditor runat="server" OnClientCommandExecuting="OnClientCommandExecuting"
    ID="RadEditor1">
</telerik:RadEditor>


Sincerely yours,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Thomas
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or