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

5 posts, 0 answers
  1. Andrew
    Andrew avatar
    12 posts
    Member since:
    May 2011

    Posted 19 Oct 2011 Link to this post

    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.
  2. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 19 Oct 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrew
    Andrew avatar
    12 posts
    Member since:
    May 2011

    Posted 19 Oct 2011 Link to this post

    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.
  5. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 19 Oct 2011 Link to this post

    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
  6. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 20 Oct 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017