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

Editor Changes Content on its own

7 Answers 171 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael Hauk
Top achievements
Rank 1
Michael Hauk asked on 16 Dec 2008, 10:42 AM
Hi,

there are 3 things i found.
All worked by just changing between View Mode and HTML View

1. A BR will be added in Tables under curtain conditions, everytime you change Views or do a Post Back
2. Table Style gets new Probertys 
Before:
style="width: 149px;"
After:
style="width: 149px; undefined: "
3. Spaces get added (I think this so HTML View looks better, but it changes the content)
Before:
<td style="width: 149px;" valign="middle">
<p>Genevieve <br />Simard</p>
</td>
After:
            <td style="width: 149px; undefined: " valign="middle">
            <p>Genevieve <br />
                        Simard</p>
            </td>
So between Genevieve and Simard are a lot of spaces now, that shouldnt be there in the content.

How can you disable this changes?
 
I want to edit the content myself, not let Rad Editor do it like he wants to.

7 Answers, 1 is accepted

Sort by
0
greenmodulus
Top achievements
Rank 1
answered on 17 Dec 2008, 01:09 AM
This is exactly the issue I've been having, and I would like to know how to disable this behavior. When I (or a web user) enters some HTML (including CSS styles) in HTML mode, I want it to be saved exactly as entered. If it's wrong, that's my (or their) problem, not the Editor's. The editor is taking the perfectly formated and compliant CSS I'm entering and turning it into malformed non-compliant CSS that is bloated and unmanageable. Some of the issues include:

1) The one you mentioned where every time the page posts back an extra <br /> is added in design mode, thus basically making the editor useless.

2) If I enter, for example, "border: solid 1px red;" that's exactly what I want. If I'd wanted "border-top 1px red solid; border-bottom: 1px red solid; border-left: 1px red solid; border-right: 1px red solid", then that's what I would have entered!

3) At seemingly random times, the editor will add an "undefined: " property in my style declaration. For example, when I type:

<div style="background: #ffffff; float: left; width: 20px; color: #4949c1; margin-right: 5px; text-align: center;">F</div>

the editor turns that into:

<div style="background: #ffffff; float: left; width: 20px; color: #4949c1; margin-right: 5px; text-align: center; undefined: ">F</div>

If I'd wanted that, I would have typed that!

There are many other examples, but basically I'd like to know how to disable the reformatting altoghter in HTML edit mode. I'd like everything saved exactly the way I entered it.

0
Accepted
Tervel
Telerik team
answered on 17 Dec 2008, 10:32 AM
Hi everyone,

Let me provide you with additional information about the reported issues. They fall in 3 categories
- browser behavior (that unfortunately is very hard to fix)
- a couple of editor bugs that have already been fixed in our internal build and the next SP2 scheduled for January will function correctly
- editor behavior that can be turned off.

I will first address David's comments:
David, the editor does feature a lot of content filters that try to fix all the inconsistencies that the browser (most often IE, which is notorious in this respect) pushes when generating HTML. I assure you that you would not like to use the default HTML generated by the browser without the editor trying to improve on in. To get a better understanding, I suggest you test with some basic web-based editor, such as FreeTextBox and see whether you are happy with the content it makes in IE.

It is also possible to set the RadEditor to not do any processing of the content by turning off its filters. For more information how to do it please examine the following example:
http://demos.telerik.com/aspnet-ajax/Editor/Examples/BuiltInContentFilters/DefaultCS.aspx

Now, up to your other questions

1) BR's - Can you please provide exact steps when this happens because we are not able to reproduce it?

2) "border: solid 1px red;"  - This behavior is trully undesired. Unfortunately, this is an IE specific behavior. You can test in all other browsers and you will see that they do not change the border style setting like that. More over, this problem is notoriously difficult to fix - please note that when you set "border: solid 1px red;" - and then you try to "get" it back - it has changed already. So the only way to do it is to use regular expressions to parse and replace the content as text, rather than manipulating element attribute settings in the DOM. This is extremely hard, given the fact that it is theoretically possible for a user to have explicitly set those settings to different colors manually, or given the fact that the user could have chosen to explicitly set just 2 or 3 sides of a cell to a border.

3) The undefined problem is really a RadEditor bug. It was introduced recently when changes were made to ensure better XHTML quality and compliance of element attributes and CSS settings. This has slipped under the radar, but we have fixed it in the internal build and the next editor update in mid January will not have the problem. In fact, we can send you a custom inhouse build for you to use - in case you need it more urgently.

We continue making changes to the editor to make the content it produces XHTML compliant in all scenarios - e.g. even when non-XHTML content is pasted from somewhere else  - be it MS Word or some HTML page. While the content filters might expose an occasional glitch, I believe turning those off will cause you much more harm than good - and you can make up your own mind by testing that.

============================================================

Michael,

1) BR's - Can you please provide exact steps when this happens because we are not able to reproduce it?

2) style="undefined - a RadEditor bug that was introduced recently. Has already been fixed.

3) As far as the way HTML looks when rendered is concerned, we were not able to find any visual difference between the two TD renderings. They looked absolutely identical. You are correct to assume that the empty spaces (which are ignored by the browser when it renders HTML) are added for easier readability of the source code when it is viewed as text. In case you wish to turn this functionality off, you should turn the IndentHTMLContent filter. Please consult the demo link above for information on how to do it.

We will be very thankful when encountering other such situations to send us the exact steps to reproduce those so that we can address them (or at least provide you with suggestions and explanations if the problem is beyond the scope of the editor). Having the editor always produce XHTML content is a top priority for us, and we address such reports within very short timeframes.

Sincerely yours,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael Hauk
Top achievements
Rank 1
answered on 17 Dec 2008, 12:36 PM
Thank you very much.

1) was caused by 3) after recalculating the content which was too long with all the spaces, so it added BR's

2) Fixed

3) Fixed
0
greenmodulus
Top achievements
Rank 1
answered on 17 Dec 2008, 05:09 PM
Thank you Tervel for your very detailed reply.

I hadn't realized that you were using the browser DOM itself to generate the HTML/CSS, or that you even could that way. I figured it was just taking a textbox input and running it through JS or something. Wow. What a headache. You're right- Firefox is worse. All kinds of proprietary Mozilla tags and junk. I suppose this would make it easier to ensure the content worked in all browsers. For 99% of the applications of this product that would be ideal. In my case however, I make sure that I write the code to work in all browsers before I enter it. But I can see how there's little Telerik could do about that.

As for the <BR> insertions, I will attempt to reproduce it. Should I send the details in a ticket, start another thread, or post them here? It could be a while before I come across it again.

Thanks again.
0
Tervel
Telerik team
answered on 19 Dec 2008, 08:57 AM
Hi all,

We just made some additional improvements to the filters mechanism - you might have noticed that in FF the browser automatically converts colors in style tags from "#XXXXXX" syntax to "rgb(xx,xx,xx)". We have extended the ConvertToXhtml filter to run a regular expression to convert those colors back to the more traditional format.

On a side note, just to point out how serious the browser-generated-junk issue is - currently the editor features 20+ built-in different content filters that are aimed at fixing various browser quirks. Only about half of them are exposed to the developer to turn on / turn off, because the other problems are so absurd that clearly should be fixed unconditionally.

Currently the only outstanding browser-induced problem that we are not sure how to fix in an efficient and reliable manner is the IE converting "border:1px solid red" into a mess of style settings. We will however expore some options to address this problem as well.

The Q3 SP2 is scheduled for mid January and will feature all the changes and improvements.

All the best,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul J
Top achievements
Rank 1
answered on 08 Jan 2009, 05:00 PM
"The Q3 SP2 is scheduled for mid January and will feature all the changes and improvements."


Can you be more specific on the release date? I'm using RadEditor for one application that allows general users to customize content for use in a catalog. I take what they enter and convert it to PDF. I could not use the built in pdf functionality as the users just cannot be trusted enough to ensure only valid xhtml, even using the radEditor's tools which help in making things valid. (Besides, they wanted to be able to keep content from previous years which contains all sorts of "microsoft junk" within the html.) Sadly, after trying various html to pdf conversion tools, I fell back on using coldfusion's cfdocument functionality, as it renders html to pdf the "best" based on my testing and experience. This is probably due to the fact Adobe owns both PDF and coldfusion. being that the rest of the application is in .NET, this was not the optimum choice, but it works.

Anyway, I am hoping updates to radEditor (including the 'undefined' bug fix) will help with display issues with the users' custom contents..

The sooner I can implement this update, the better, as the users are only using the application for the current month only.

Thanks.
0
Tervel
Telerik team
answered on 09 Jan 2009, 02:04 PM
Hello Paul J,

The Q3 SP2 2008 is scheduled for next week - Tuesday or Wednesday, that is Jan 13th or 14th.


Kind regards,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Michael Hauk
Top achievements
Rank 1
Answers by
greenmodulus
Top achievements
Rank 1
Tervel
Telerik team
Michael Hauk
Top achievements
Rank 1
Paul J
Top achievements
Rank 1
Share this question
or