Why does Google Testing Tool use the “id” attribute to generate a URL for the Microdata item?

前端 未结 1 688
陌清茗
陌清茗 2020-12-02 01:48

I\'m using some Microdata to describe a blog post, and I\'m surprised by the value return for Schema.org’s BlogPosting by the Google Developers Testing Tool.

相关标签:
1条回答
  • 2020-12-02 02:33

    This is strange.

    It’s definitely not conforming to the Microdata Note. Apart from Microdata’s itemref attribute, HTML5’s id attribute has no special meaning in Microdata.

    If Google wants to use the id value anyway, they should at least generate the URL with a fragment identifier, i.e., http://www.example.com/#foobar.

    My guess is that they are (probably unintentionally) handling HTML5’s id attribute the same way as Microdata’s itemid attribute. If using itemid instead of id in your example, Google’s Testing Tool output is the same, but this time correct.

    0 讨论(0)
提交回复
热议问题