RadEditor partially strips out html5 microdata

5 posts, 0 answers
  1. Jochem Bökkers
    Jochem Bökkers avatar
    11 posts
    Member since:
    Aug 2007

    Posted 23 Aug 2012 Link to this post

    Hey,

    When using the RadEditor to markup some html5 microdata, it seems to strip out the 'itemscope' property.

    So when in HTML pane pasting something like:
    <span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
        <meta itemprop="latitude" content="1.23456" />
        <meta itemprop="longitude" content="1.23456" />
    </span>

    it saves it like this:

    <span itemprop="geo" itemtype="http://schema.org/GeoCoordinates">
        <meta itemprop="latitude" content="1.23456" />
        <meta itemprop="longitude" content="1.23456" />
    </span>

    This happens both on <span> and <div> and not just on geo microdata but all items containing 'itemscope'.

    In this case I'm using the RadEditor inside Sitefinity v5.1, but after confirming Sitefinity doesn't strip/filter anything and its a RadEditor issue, I'm posting the question here...

    Has anyone run into this and found a workaround ?

    Jochem
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 27 Aug 2012 Link to this post

    Hello,

    RadEditor is an XHTML editor and it does not offer direct support for HTML5 tags and attributes. Its content area is an editable iframe/div element which uses the Rich Text Editing engine of the used browser. The older browsers do not support HTML5 and some HTML5 tags / attributes could be stripped by the Rich Text Editing engine under them.

    My recommendation is to disable the ConvertToXhtml filter of RadEditor. The purpose of the ConvertToXhtml filter is to validate the HTML tags and makes them XHTML. In some scenarios this filter could break the HTML5 tags (because they are not supported by the XHTML specification) and for this reason I suggest to disable it.

    Greetings,
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jochem Bökkers
    Jochem Bökkers avatar
    11 posts
    Member since:
    Aug 2007

    Posted 26 Sep 2012 Link to this post

    Hey Rumen,

    Sorry for not replying yet. 

    Ok, annoying ;) but makes perfect sense.
    But here's another one for you, which i believe is 'valid xhtml':

    <span class="k-widget k-dropdown k-header k-j-small">
        <span class="k-dropdown-wrap k-state-default">
            <span class="k-input">
                Services
            </span>
            <span class="k-select">
                <span class="k-icon k-arrow-down">select</span>
            </span>
        </span>
    </span>

    Class-itis yes, but nothing wrong with it. Now if I paste that into HTML view, save and edit again - my outer span has been removed and the Editor tells me the content is:

    <span class="k-dropdown-wrap k-state-default">
      <span class="k-input">
        Services
      </span>
    <span class="k-icon k-arrow-down"> select </span>  </span>

    Any suggestions on this?

    Jochem
  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 29 Sep 2012 Link to this post

    Hello,

    To fix the reported issue disable the filter of RadEditor.

    Kind 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.
  6. Petar
    Petar avatar
    1 posts
    Member since:
    Jul 2011

    Posted 26 Mar 2014 Link to this post

    Hi Jochem,

    I just read the thread and found some info if it's still relevant for you or other users. Essentially, the RadEditor removes the itemscope attribute only because it doesn't have a value.

    So to be able to fully comply to schema.org microdata with the current functionality of RadEditor, you need to add a value to the itemscope. You can use something like this: itemscope="" or itemscope="itemscope".

    Both shall work just fine with search engines and will be preserved by the RadEditor markup cop, which is what you need :)

    I spoke with the RadEditor guys and it seems that they are up to something new to address situations with HTML5 attributes with no values, so in the next few month there might be very good new stuff as usual!

    Cheers,
    Peter





Back to Top
UI for ASP.NET Ajax is Ready for VS 2017