diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 0ee6614..194af2a 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -567,10 +567,9 @@ function rdf_preprocess_image(&$variables) { */ function template_preprocess_rdf_metadata(&$variables) { foreach ($variables['metadata'] as $key => $attributes) { - // Add a class so that developers viewing the HTML source can see why there - // are empty tags in the document. - $attributes['class'][] = 'rdf-meta'; - $attributes['class'][] = 'hidden'; + if (!isset($attributes)) { + $attributes = array(); + } // The XHTML+RDFa doctype allows either or syntax to // be used, but for maximum browser compatibility, W3C recommends the // former when serving pages using the text/html media type, see diff --git a/core/modules/rdf/templates/rdf-metadata.html.twig b/core/modules/rdf/templates/rdf-metadata.html.twig index 81a2f3c..ec68e13 100644 --- a/core/modules/rdf/templates/rdf-metadata.html.twig +++ b/core/modules/rdf/templates/rdf-metadata.html.twig @@ -13,5 +13,11 @@ */ #} {% for attributes in metadata %} - + {% + set classes = [ + 'rdf-meta', + 'hidden', + ] + %} + {% endfor %}