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

Why does the Editor automatically add quotes around my attribute values?

4 Answers 66 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 19 Oct 2011, 04:31 PM
Let's say that I have this text here exactly as it is typed into HTML view, I have only bolded the attribute value to distinguish the change that the Editor made automatically, the bolding is not in the original test:

<p name=pStySM1T008_TT>Enroll now,<br>PLUS use the special offer inside before January 14th!<br><br></p>

Now, the instant that I switch from HTML to Design and back to HTML, the text has changed to this:

<p name="pStySM1T008_TT">Enroll now,<br>PLUS use the special offer inside before January 14th!<br><br></p>

I have also made sure that this is reproducible in the Telerik Content Filters Demo here: http://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx

My first thought was to remove the ConvertToXhtml filter, but I have tried disabling all filters, as well as enabling various combinations of filters and I am still unable to prevent the quotes from automatically appearing around my attribute values. I absolutely do not want the Editor to make assumptions about how to treat or reformat my content.

4 Answers, 1 is accepted

Sort by
0
Stuart Hemming
Top achievements
Rank 2
answered on 19 Oct 2011, 04:46 PM
Andrew,

I'd guess that it's because the spec for valid XML (and therefore good practice when writing HTML) says that all attributes should have their values in quotes.

I imagine that when the html parser processes the code you've entered it does this as a matter of course.

I don't know if this behaviour is configurable. If it is, it'll be in the docs, although, if I had to bet, I'd guess that it's not.

-- 
Stuart
0
Andrew
Top achievements
Rank 1
answered on 19 Oct 2011, 05:04 PM
Thanks for your reply Stuart,

Unfortunately, the sample that I wrote is not exactly standard HTML, I realize that the sample that I provided looks very similar, some tags are very different and do not exist at all in standard HTML, it's subtly different and used exclusively within the company that I work for. So my need for the Editor to not make any assumptions about any content and make any automatic reformatting is absolutely imperative for us to be able to use the Rad Editor in any degree of effectiveness.
0
Stuart Hemming
Top achievements
Rank 2
answered on 19 Oct 2011, 05:23 PM
Andrew,

First let me say that for a definitive reply you're going to have to wait for a grown-up from Telerik Towers to comment.

However, I would think that the editor is going to (have?) to assume that the html markup it encounters is 'standard' to extent or another and is going to behave accordingly.

Again, can I suggest reading the docs to see if you can modify the default behaviour wrt to non-standard mark-up? You never know, there might just be something that the clever boys and girls at Telerik have already done that might be of value/help.

-- 
Stuart
0
Rumen
Telerik team
answered on 20 Oct 2011, 11:55 AM
Hi guys,

The rich text editing engine of IE9 is enhanced and makes sure that all attributes' values are wrapped in quotes, which is a requirement by the XHTML specification. It is not possible to turn off this browser behavior even after disabling the ConvertToXhtml filter of RadEditor which also ensures that the attributes' values have quotes.

What you can do is to disable the ConvertToXhtml filter and render the page in IE8 mode using the following meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=8" />


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
Tags
Editor
Asked by
Andrew
Top achievements
Rank 1
Answers by
Stuart Hemming
Top achievements
Rank 2
Andrew
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or