Mobile app version of vmapp.org
Login or Join
Gretchen104

: Microdata and replacing entities for display The question is about using Microdata to replace entities inside the Schema.org properties description or articleBody: <p>Lorem ipsum dolor sit amet,

@Gretchen104

Posted in: #Html5 #Microdata #SchemaOrg

The question is about using Microdata to replace entities inside the Schema.org properties description or articleBody:

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (<a href="http://winchdesign.com" target="_blank">winchdesign.com</a>)</p>


if we replace entities it will show:

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (&lt;a href=&quot;http://winchdesign.com&quot; target=&quot;_blank&quot;&gt;winchdesign.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;(&lt;a href=&quot;http://robbreport.com&quot; target=&quot;_blank&quot;&gt;robbreport.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;


Is that allowed in Microdata?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gretchen104

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

The Schema.org properties articleBody and description expect Text as value. If you want to follow this advice, you have to specify the properties (in itemprop) on an element that creates a string value (these are most elements, e.g., div).

So let’s say you use <div itemprop="articleBody"></div>. It’s the textContent of that element that will be used as value.

First example

<div itemprop="articleBody">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (<a href="http://winchdesign.com" target="_blank">winchdesign.com</a>)</p>
</div>


It generates this property value:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (winchdesign.com)


As you can see, this is readable text. This is what you probably want to provide.

Second example

<div itemprop="articleBody">
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (&lt;a href=&quot;http://winchdesign.com&quot; target=&quot;_blank&quot;&gt;winchdesign.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;(&lt;a href=&quot;http://robbreport.com&quot; target=&quot;_blank&quot;&gt;robbreport.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
</div>


It generates this property value:



<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (<a href="http://winchdesign.com" target="_blank">winchdesign.com</a>)</p> <p>(<a href="http://robbreport.com" target="_blank">robbreport.com</a>)</p> <p> </p>


As you can see, this text contains parts that look like HTML, but they will be interpreted as plain text (!). So this probably not what you want to provide.

To give a clearer example:




<span itemprop="name">John</span>: The name is "John".
<span itemprop="name"><b>John</b></span>: The name is "John".
<span itemprop="name">&lt;b&gt;John&lt;/b&gt;</span>: The name is "<b>John</b>".

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme