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

How to Disable auto correction of html elements

13 Answers 222 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 17 Dec 2010, 05:58 PM
When I place html in RadEditor,  it seems to try to automatically correct malformed html tags or insert proper thing such as ALT attributes for images which is fine in most cases.

However, in my case, I have a valid html document but I want to insert custom placeholders in the markup, which will be replaced by some other application later.

For example.

Instead of  a valid <tr>blah blah </tr>

I have {$DetailLines}  which my app replaces later dynamically with x number of <tr></tr>  lines.

However, Rad Editor will alter my placeholder to something like <>{$DetailLines}</>   

Is there an easy way to just turn this auto correction off.  I don't need it on!

Thanks

13 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 21 Dec 2010, 09:12 AM
Hi Chris,

Can you please disable the ConvertToXhtml filter and test your non valid XHTML content once again, e.g.
RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertToXhtml);

Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
tasos
Top achievements
Rank 1
answered on 24 Feb 2012, 02:38 PM
Hello.I have this same issue but the removal of the filter doesn't work.
I have something like
<table>
<tr>
<td>
...
</td>
</tr>
 
<ad:foreach collection="[#OrderLines#]" var="OrderLines" index="i"
<tr style="page-break-inside: avoid; height: 7.2pt">
                    <td class="tableRow">
                        <p class="cellData">
                           [#i#]
                        </p>
                    </td>
                    <td class="tableRow" style="text-align: right">
                        <p class="cellData">
                            {#OrderLines.Quantity#}
                        </p>
                    </td>
 
                </tr>
</ad:foreach>
</table>
And when switching from the html tag to design and then back to html i get
    {ad:foreach collection="[#OrderLines#]" var="OrderLines" index="i"}
 
{/ad:foreach}
                <table>
<tr>
<td>
...
</td>
</tr>
</table>

Can you please help me?
Thanks!
0
Rumen
Telerik team
answered on 24 Feb 2012, 03:27 PM
Hi,

Under which browser do you experience this problem?
Are you able to reproduce it in the Default Example of RadEditor?

Regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
tasos
Top achievements
Rank 1
answered on 24 Feb 2012, 10:19 PM
I have used the default example as you said.
In ie8 it  works as expected.In firefox and chrome it doesn't.
Any ideas on how to solve this problem?
Btw i'm not using the latest version of the editor.
0
Rumen
Telerik team
answered on 28 Feb 2012, 02:46 PM
Hello,

You should note that in HTML table element you can put content only inside the <td> elements, but not between the <tr> elements, because this will produce invalid content and the browser itself will correct it.

The content area of RadEditor is a standard editable iframe element which uses the rich text editing engine of the browser to render and produce content. My suggestion is to correct your custom content so that it is not altered by the browser using the attached editable IFRAME page and once you do that you will not experience the problem in RadEditor as well.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
tasos
Top achievements
Rank 1
answered on 28 Feb 2012, 02:50 PM
Thank you Rumen.
0
Veysel
Top achievements
Rank 1
answered on 10 Feb 2014, 05:13 PM
Hi Rumen,
4 years after the last post I have the same problem. I could not find any solution. I want to ask after this message.
Use the special tag in a similar manner to myself that I'm an html codes var.editör do not want to do any auto-correction. Just know that you must run it on the html tag. to my code should not interfere.
I reviewed your posts and I did try but did not get any results.
my html code example is as follows;

<XX_HEAD> <TABLE Border=1>
  <TBODY>
    <TR>
      <TD> Exam header 1 </ TD>
      <TD> Exam header 2 </ TD>
    </ TR>
   <XX_SHOW #AA,BB#>
    <XX_TR>
     <TD> [VAL1 <XX_01>] </ TD>
     <TD> [VAL2 <XX_02>] </ TD>
    </ XX_T is>
   </ XX_SHOW>
  </ TBODY>
</ TABLE>
</ XX_HEAD>

RadEditor in an encoding which features off or how I need to do? Could you please give this matter urgent information.

Thank you in advance.
Veysel
0
Ianko
Telerik team
answered on 12 Feb 2014, 03:06 PM
Hi Veysel,

You should be aware that the RadEditor control is based on a n editable iframe which is mostly controlled by the browser. As Rumen suggest the ConvertToXhtml filter is cleaning some tags and corrects some of the HTML inserted and you can disable it, also you can disable all filters by setting the
ContentFilters="None" property. Also you can test the normal browser behavior of the editable element with the provided editable Iframe.

Note that even when the editable iframe is used, the browser content filters are still respected and will affect the HTML content. The modern browser do that, so that they could render correctly a malformed HTML. Note that if appears that the reported is due to such filters, I should inform you that we cannot provide a proper approach to disable them or use a workaround for such issue.

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Veysel
Top achievements
Rank 1
answered on 13 Feb 2014, 09:20 AM
Hello Ianko ,

Thank you for the information .

I think I need a bit complicated to RadEditor . But I think you can make them for Telerik-Team :).

In my project I am using RadEditor DIV mode . Because a lot of elements , other than RadEditor Rad-elements need to DragDrop into . Therefore Iframe opens modal mode and I 'm helpless when it opened.

I 'll write about my needs ,
*) must be in RadEditor DIV mode ,
*) Cross Browser should be ,
*) My my custom tag ( example above there ) should not change ( the filter should not be anything - RadEditor doesnt touch to my html source)

IE8 compatibility mode Iframe content filter case study is getting everything we make . But I can not give a single page in IE8 mode . All my ASPX page in my project is affected. Also I do not want to use iframe mode .
Why DIV mode " contentfilters = None" does not work ? Is there a remedy for this ?

Maybe Some functions in Telerik.js files overwriting Can it ?I hope Telerik team on this issue me and the other to find solutions to those in need .

I am eagerly waiting for the answer .
Thank you again .

Veysel
dynamicquery.net
0
Ianko
Telerik team
answered on 17 Feb 2014, 10:57 AM
Hello Veysel,

You can configure the RadEditor control with a DIV content area by setting the ContentAreaMode="Div". In this demo is provided more information about this option.

The RadEditor control comes with a cross browser functionality and I can only make assumptions about the specific exceptions from this requirement. Note that every customization and additional implemented logic should be done accordingly to the application requirements and limitations. Due to that I cannot provide a firm solutions to custom functionalities, I can only suggest approaches for its implementation.

As I mentioned the desired tags are not supported by the browser and the RadEditor control is an XHTML editor and should be used only with valid and supported HTML elements. Using custom tags cannot be used within an editable content area, I can only suggest finding an alternative approach to achieve the desired functionality.

Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Veysel
Top achievements
Rank 1
answered on 15 Aug 2014, 08:02 AM
Hi Ianko and Rumen,


The problem still continues.

When I change the mode of RadEditor.
RadEditor option does not give me the flexibility. I want to ape what I wrote earlier. I have a special TAG command in their software. I have to use them within the HTML code. but my special TAG RadEditor all the HTML code and change my command.
Also converts all HTML commands to lowercase. I do not want to make changes Radeditor.

I would like to try from you I wrote earlier examples. I need an urgent solution to this issue. I can not believe such a request coming from other users.
please make immediate support in this regard. I'm in a project that, because of time constraints. I'm going to lose money if this solve the problem soon if I do not.

again I am sending you an example.

<TABLE>
    <TBODY>
        <TR>
            <TH>TEST 1 HEA</TH>
            <TH>TEST 2 HEAD</TH>
        </TR>
        <XX_DATA #40,1#>
            <XX_TR>
                   <TD><XX_001> TEST1 </TD>
                   <TD><XX_002> TEST2 </TD>
         </XX_TR>
        </XX_DATA>
    </TBODY>
</TABLE>


please ... please ...

Veysel,
0
Marin Bratanov
Telerik team
answered on 19 Aug 2014, 11:17 AM

Hi Veysel,

As my colleagues already explained, RadEditor is an XHTML editor based on the rich-text editing engine of the browser.

This means that even when the RadEditor does not change the content (the ConvertToXhtml filter is disabled, as advised in the very first post from Rumen), the browser will attempt to fix the HTML content to make it valid.

Thus, it is the browser that changes the content and breaks your custom tags because it cannot parse them.

I am afraid that there is no workaround for this, apart from creating content that will pass XHTML validation and using that instead of the invalid content you have.

We cannot guarantee proper functionality with invalid content. Nevertheless, I tried your markup with disabled filters and the RadEditor behaves just like a simple editable div. I am attaching here a short video and a small sample that demonstrate this. If this does not suffice for your needs, I would advise that you move to XHTML-valid content.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Veysel
Top achievements
Rank 1
answered on 19 Aug 2014, 11:43 AM
Hi Marin,
Thank you for your detailed answer. Especially for video.

We can not use it the way you say DIVA. I did debug the "Telerik-UI" source code. I thought by Telerik HTML tags are changing. BODY's innerHTML = method depends on the version of IE being done this process. Telerik helpless here.

Now, we have used these solutions. We did not do the new tags. we used the description tag "<! - xxx ->" like normal tag. For our project, we changed. Because there was no time.

Thank you again for explaned answer.
Now we know a lot more with your help.

Veysel Ispir
DynamicQuery.Net
Tags
Editor
Asked by
Chris
Top achievements
Rank 1
Answers by
Rumen
Telerik team
tasos
Top achievements
Rank 1
Veysel
Top achievements
Rank 1
Ianko
Telerik team
Marin Bratanov
Telerik team
Share this question
or