The current implementation of the custom content attributes, for example:
<div class="drupal-embed" nid="20" view_mode="teaser" >
Breaks the HTML5 validation. Fortunately the current HTML5 spec allows for custom attributes:
http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#custom-data-at....
The new rendered code would look like:
<div class="drupal-embed" data-nid="20" data-view_mode="teaser" >

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fxarte’s picture

This patch replaces the original values nid and view_modes with data-nid and data-view_mode by expanding the replacement already present in the module:

    $matches[0] = preg_replace(
      array('/(nid|view_mode)="(.*?)"/', '/embed_type=".*?"[ ]*/', '/>.*</'),
      array('data-${1}="${2}"', '', '>' . $cb($info) . '<'),
      $matches[0]
    );