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

RadEditor partially strips out html5 microdata

4 Answers 99 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jochem Bökkers
Top achievements
Rank 2
Jochem Bökkers asked on 23 Aug 2012, 08:38 AM
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

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Aug 2012, 09:58 AM
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.
0
Jochem Bökkers
Top achievements
Rank 2
answered on 26 Sep 2012, 11:48 AM
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
0
Rumen
Telerik team
answered on 29 Sep 2012, 08:09 AM
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.
0
Petar
Top achievements
Rank 1
answered on 26 Mar 2014, 02:37 PM
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





Tags
Editor
Asked by
Jochem Bökkers
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Jochem Bökkers
Top achievements
Rank 2
Petar
Top achievements
Rank 1
Share this question
or