Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jeff Burnz’s picture

jessebeach’s picture

subscribe

Jacine’s picture

What we need to do here is change the doctype to HTML5 and stop hard coding the RDFa parts. When the RDF module is disabled, we should just have a plain jane HTML5 doctype. The rest of the file looks okay. This is the code in question:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
  "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>>
 <head profile="<?php print $grddl_profile; ?>">

We could do something similar to what @Jeff Burnz did in contrib, basically making the doctype a variable. See template and preprocess.

Regarding the <head profile="<?php print $grddl_profile; ?>">, Lin Clark recommends not using the profile attribute:

One minor problem is the version attribute—in HTML 5 it is deprecated, but the HTML+RDFa spec layers it back in (a weird thing that all of the specs on top of HTML can do). The version attribute isn't required, it simply gives guidance to RDFa consumers, so I would recommend not using it.

skottler’s picture

subscribe

karschsp’s picture

Status: Active » Needs review
FileSize
2.2 KB

Here's a patch that basically implements what Jacine outlined in #3.

Status: Needs review » Needs work

The last submitted patch, html.tpl_.php-html5-1077566.005.patch, failed testing.

karschsp’s picture

Hmmm...not sure why the tests failed. It passed locally.

skottler’s picture

I believe you may need to alter the test suite because it expects the doctype to be of a certain type so changing this causes a failure.

jessebeach’s picture

skottler, where is the test suite we should look at?

skottler’s picture

@jessebeach, {docroot}/modules/simpletest/tests/

skottler’s picture

@jessebeach, I believe that most of the markup testing and element checking is in common.test.

RobLoach’s picture

+++ b/includes/theme.incundefined
@@ -2192,8 +2192,15 @@ function template_preprocess_html(&$variables) {
   // using an associated GRDDL profile.
-  $variables['rdf_namespaces']    = drupal_get_rdf_namespaces();
-  $variables['grddl_profile']     = 'http://www.w3.org/1999/xhtml/vocab';
+  if (module_exists('rdf')) {
+    $variables['rdf_namespaces']    = drupal_get_rdf_namespaces();
+    $variables['grddl_profile']     = 'http://www.w3.org/1999/xhtml/vocab';
+    $variables['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
+  } else {
+    $variables['rdf_namespaces'] = '';
+    $variables['grddl_profile'] = '';
+    $variables['doctype'] = '<!DOCTYPE html>' . "\n";

Can't we have an alter hook in the RDF module to add these variables in? This just seems wrong.

-1 days to next Drupal core point release.

jessebeach’s picture

Agreed. The <html> attributes should be printed with drupal_attributes() so modules can modify them. That way the RDf module can push it's attributes to the template without theme.inc knowing anything about it. I'll look at rerolling this.

jessebeach’s picture

I modified @karschsp's patch for this one.

1. The RDF-specific variables are now defined in rdf_preprocess_html instead of template_preprocess_html in theme.inc.
2. I moved attributes from the html.tpl.php file into arrays in preprocess functions so they are printed with drupal_attributes().
3. I deleted the drupal_get_rdf_namespaces function from common.inc. It was used only once in core, to pull a string of namespaces into the html.tpl.php file. This is better achieved through the hook system and attribute arrays in the rdf module so these values can be modified by other modules before rendering.

I ran all the RDF tests on this patch and everything passed.

I'm leaving this as needs work because I'm anticipating some churn on this before it's ready to commit.

RobLoach’s picture

Status: Needs review » Needs work

Like! Like! Like! I understand leaving it in needs work, but I'd like to see what the testbot says :-).

+++ b/modules/system/html.tpl.phpundefined
@@ -40,22 +42,21 @@
+  <head<?php print $title_attributes; ?>>
+    <?php print $head; ?>
+    <title><?php print $head_title; ?></title>
+    <?php print $styles; ?>
+    <?php print $scripts; ?>

Should this be $variables['head_attributes'] and $head_attributes instead of $title_attributes?

-2 days to next Drupal core point release.

RobLoach’s picture

RobLoach’s picture

Status: Needs work » Needs review

How do I forget to change the Status twice?

The last submitted patch, convert_html-tpl-php_to-HTML5-1077566-14.patch, failed testing.

karschsp’s picture

This one just cleans up a couple whitespace issues in #14. Still CNW.

Everett Zufelt’s picture

Comments against #19

  *
  * This function can be called as long the headers aren't sent. Pass no

'...as long as the headers...'

Not part of this patch, but might just as well be corrected.

+  // GRDDL provides mechanisms for extraction of this RDF content via XSLT
+  // transformation using an associated GRDDL profile.
+  $variables['title_attributes_array'] = array(

Agreed that we should create a new $variables]'head_attributes'] = array(); title_attributes is intended to be used for things like node / block / other 'titleish' things, in head this would most appropriately be <title>, which needs no attributes.

+ <body class="<?php print $classes; ?>" <?php print $content_attributes;?>>

Classes should go in $variables['content_attributes']['class']; At its best the classes_array should be used for classes on the wrapper, only printed where attributes_array is printed, at its worst classes_array should be purged from Core :)

Jeff Burnz’s picture

classes_array should be purged from Core

Completely off topic but +1000 to that!

Sorry, real review coming :)

skottler’s picture

Status: Needs work » Needs review

Initiating the test bot.

Status: Needs review » Needs work

The last submitted patch, convert_html-tpl-php_to-HTML5-1077566-19.patch, failed testing.

karschsp’s picture

Patch adds a new head_attributes array. Tests pass locally, but lets see what the bot thinks.

Everett Zufelt’s picture

Status: Needs work » Needs review

bots

Status: Needs review » Needs work

The last submitted patch, convert_html-tpl-php_to-HTML5-1077566-23.patch, failed testing.

Everett Zufelt’s picture

Status: Needs work » Needs review

Since head_attributes_array is only used in the html template, it should likely be defined in template_preprocess_html() and not in _template_preprocess_default_variables(). It then then be flattened in template_process_html(). This will still allow rdf_preprocess_html() to add to the array before flattening.

Everett Zufelt’s picture

Status: Needs review » Needs work

x-post

karschsp’s picture

Status: Needs work » Needs review
FileSize
8.02 KB

something like this?

Anonymous’s picture

I can take a look at this to see where the RDF test is failing and debug/rewrite the test if necessary.

Just a couple quick style things I noticed with a quick look with Dreditor...

  • A few whitespace issues were reintroduced.
  • It mixes the use of single and double quotes. For example, there is a line with "\n". It would be better to use single quotes here for consistency, though sometimes it makes sense to use double quotes.
    +++ b/includes/theme.incundefined
    @@ -2221,13 +2222,14 @@ function template_preprocess_html(&$variables) {
    +  $variables['doctype'] = '<!DOCTYPE html>' . "\n";
    

I'm going to leave this at NR though so the test will run.

0 days to next Drupal core point release.

Status: Needs review » Needs work

The last submitted patch, convert_html-tpl-php_to-HTML5-1077566-24.patch, failed testing.

karschsp’s picture

Status: Needs work » Needs review
FileSize
7.98 KB

Attached cleans up the whitespace and \n issues noted by @linclark in #30.

Everett Zufelt’s picture

Status: Needs review » Needs work

@@ -2167,7 +2167,8 @@ function template_process(&$variables, $hook) {
// Flatten out classes.
$variables['classes'] = implode(' ', $variables['classes_array']);

- // Flatten out attributes, title_attributes, and content_attributes.
+ // Flatten out attributes, head_attributes, title_attributes, and
+ // content_attributes.
// Because this function can be called very often, and often with empty

* Doc change needs to be removed, no longer touching this func.

+
+ $head_attributes_array = array();
+ $variables['head_attributes'] = $head_attributes_array ? drupal_attributes($head_attributes_array) : '';

* You have this in template_preprocess_html

You should have:

$variables['head_attributes_array'] = array();

and then in template_process_html()

$variables['head_attributes'] = $variables['head_attributes_array'] ? drupal_attributes($variables['head_attributes_array']) : '';

* Essentially we create the array in template_preprocess_html() so that rdf_preprocess_html() or any other preprocess hooks can alter it, and then we flatten in the next step in template_process_html().

+ // GRDDL provides mechanisms for extraction of this RDF content via XSLT
+ // transformation using an associated GRDDL profile.
+ $variables['title_attributes_array'] = array(
+ 'profile' => 'http://www.w3.org/1999/xhtml/vocab',
+ );

* 1. $title_attributes doesn't seem to be used in the template (not sure if you were looking for head_attributes_array, or something else here.
2. By setting the array you are overwritting anything else stored in title_attributes_array, so you need to do something like
$variables['foo']['profile'] = 'http://www.w3.org/1999/xhtml/vocab';

Anonymous’s picture

+++ b/modules/rdf/rdf.moduleundefined
@@ -267,8 +267,8 @@ function rdf_mapping_delete($type, $bundle) {
+ * $head_attributes, $title_attributes, $content_attributes and the ¶
+ * field-specific $item_attributes variables. For more information, see

I don't think we need to add a mention to the head attributes here.

+  foreach(rdf_get_namespaces() as $prefix => $uri) {
+    $variables['head_attributes_array']['xmlns:' . $prefix] = $uri;
+  }
+  // Set the HTML version to XHTML+RDFa 1.0.
+  $variables['head_attributes_array']['version'] = "XHTML+RDFa 1.0";
+  // GRDDL provides mechanisms for extraction of this RDF content via XSLT
+  // transformation using an associated GRDDL profile.
+  $variables['title_attributes_array'] = array(
+    'profile' => 'http://www.w3.org/1999/xhtml/vocab',
+  );
+  // Change the doctype to include RDFa.
+  $variables['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
+}

This stuff in rdf_process needs some work.

  • Since we will be using RDFa 1.1, we want to update the use of xmlns because 1.1 deprecates it. Instead, we should use the prefix attribute, which looks like this prefix="dbr: http://dbpedia.org/resource/".
  • We should switch the version to RDFa 1.1. I'll touch base with the RDFa WG to see what the latest recommendation is, but AFAIK we don't really even need to include the version attribute.
  • I don't even think we need to use a special DOCTYPE, we can just use the regular html doctype. Will double check this.
RobLoach’s picture

Issue tags: +Framework Initiative

Adding the Framework Initiative tag since this helps clean up some of the cruft from the RDFa system that should be in the RDF module itself. I'll hopefully get some time over the coming week to have a closer look.

scor’s picture

Although I'm in the RDFa WG, this is just my personal opinion. RDFa 1.1 encourages the use of the RDFa doctype and @version to help parsers understand what version of RDFa they use for the parsing. But in the case of Drupal, I don't think we should include them. We should keep the doctype neutral, since it is not mandatory to include the RDFa doctype or @version to support RDFa. That's the way I've done it so far in the themes I've built in HTML5/RDFa 1.1.

The @prefix should be there however. A few weeks back Manu and Ivan raised an issue re. charset detection failing on some browsers when the @prefix contains too many characters, but since Drupal declares the UTF8 charset in the HTTP header, this is not an issue for us.

Just to make it clear in the case of several prefix declaration, they should all be in the same prefix attribute (not like the xmlns case) like so:

prefix="dc: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/"
Jeff Burnz’s picture

scor, just to be absolutely clear on the doctype, you're saying only use <!DOCTYPE html> all the time, correct?

scor’s picture

Jeff: yes, just the regular doctype you would use in HTML5.

jessebeach’s picture

Jacine’s picture

Issue tags: +D8H5

Tagging for the next sprint.

dcmouyard’s picture

Issue tags: -D8H5

How do people feel about using IE conditional comments for the <html> element, like HTML5 Boilerplate?

<!--[if lt IE 7]> <html class="ie6 no-js" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]-->
<!--[if IE 7]> <html class="ie7 no-js" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]-->
<!--[if IE 8]> <html class="ie8 no-js" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]-->
<!--[if IE 9]> <html class="ie9 no-js" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"<?php print $rdf->version . $rdf->namespaces; ?>> <!--<![endif]-->
Jacine’s picture

Issue tags: +D8H5

I actually hate the idea, TBH. I think this is something a theme should decide to do. I don't use this technique personally.

Adding the sprint tags back with the right month this time ;)

jessebeach’s picture

Agreed that such a tactic (#41) should be used only when required i.e. in a template override for a specific site or project. Using a scoping class at the hmtl root level is killer for performance. Having the classes there, all shiny and pretty, is a temptation all too unavoidable for module developers looking for a quick fix.

It's so sad that we need to expend so much time and energy on one browser.

Thanks for the suggestion @dcmouyard. Keep pinging the queues with these kinds of ideas. I think we're going to be somewhat conservative on what goes into core templates, but that doesn't mean techniques like these shouldn't be considered.

scor’s picture

Assigned: Unassigned » scor

I've got a patch coming soon for fixing tests and aligning with RDFa 1.1.

scor’s picture

Status: Needs work » Needs review
FileSize
9.71 KB

This patch:
- removes the variable doctype and uses a fixed HTML5 doctype instead
- serializes RDF namespace prefix bindings into the prefix attribute according to RDFa 1.1
- removes the head_attributes variable from the html.tpl.php (not needed for RDFa, and I'm not sure we need it at all). there might be some left over in the docs
- fixed the tests to work with the prefix attribute

scor’s picture

moving tests from common.test to rdf.test

ericduran’s picture

Could we name the html attribute html_attributes instead of attributes?

Zen and html5_tools both use html_attributes.

I'm confused as to where content_attributes is coming from. Did I miss something?

Everett Zufelt’s picture

Status: Needs review » Needs work
@@ -2291,7 +2291,8 @@ function template_process(&$variables, $hook) {
   // Flatten out classes.
   $variables['classes'] = implode(' ', $variables['classes_array']);
 
-  // Flatten out attributes, title_attributes, and content_attributes.
+  // Flatten out attributes, head_attributes, title_attributes, and
+  // content_attributes.
   // Because this function can be called very often, and often with empty

* This comment modification is unnecessary. We should remove all references to head_attributes if not used.

-  $variables['language']          = $GLOBALS['language'];
-  $variables['language']->dir     = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
+  // HTML element attributes.
+  $variables['attributes_array'] = array(
+    'xmlns' => "http://www.w3.org/1999/xhtml",

* $variables['attributes_array'] already exists, it is created by template_preprocess() and hooks may have already been fired that modify it, so it is best practice not to overwrite.

+?><!DOCTYPE html>

Are we certain that we don't want a variable for this. Makes it easier to modify. Although, I suppose that anyone changing it might likely change the tpl anyway.

+ <body class="<?php print $classes; ?>" <?php print $content_attributes;?>>

* class should be a key in content_attributes_array. We shouldn't be using classes_array here.

There actually is nothing ,that I know of, in content_attributes at this point, but it is useful to print it just in case it is altered, the whole point of the array is that it can be altered by any theme hook, that is why it is created by template_preprocess.

Jeff Burnz’s picture

Is removing or no longer using classes_array's something we are officially doing now, that feels like a follow up issue that we just do everywhere all in one go, if that is what is happening.

Everett Zufelt’s picture

@Jeff

Regardless of what we do with classes_array as a whole, it doesn't belong paired with content_attributes. classes_array is meant, afaik, to be paired with attributes_array. If we are going to keep classes_array, it needs to be implemented consistently.

Jeff Burnz’s picture

Well, I rather see consistency as being $classes, $title_classes, $content_classes because in reality everyone is abusing attributes arrays to push in classes. I don't think anyone actually wants $title_classes and $content_classes at all, and I personally prefer to keep up the abuse to the point of simply doing everything in attributes arrays in core - pave the cowpaths so to speak.

I can see the point of moving attributes to html element and using content_attributes on the body element, so for consistency we should consider title_attributes for the page title (another patch, another issue, just noting it), however is it just me or does "content_attributes" feel weird on the body, and honestly I prefer Eric Durans suggestion of special casing an html_attributes variable.

I'll shut up now. Great work scor.

Jacine’s picture

Issue tags: -D8H5 +sprint

I think we need to special case this. I agree content_attributes is not going to work. We need to be able to count on that being an actual content wrapper in template_preprocess() for example. I'm fine with using html_attributes here if that's what everyone else wants to do. Let's try to move this forward.

The classes_array discussion needs to happen separately. Is there already an issue open for this? If not can someone create one?

Anonymous’s picture

This issue was posted about the classes array #1290694: Provide consistency for attributes and classes arrays provided by template_preprocess().

Also, there is an issue where effulgensia describes classes_array and how you aren't supposed to add classes to the attributes array from 2009, but I can't find it atm... and I don't think that old post is really valid anymore, since there is an example in core that uses an attributes array to place a class.

EDIT: Here is the issue I was talking about #569362: Document $attributes, $title_attributes, and $content_attributes template variables. Thinking about classes arrays seems to have moved on since then, though.

jessebeach’s picture

@linclark, I don't know if I'm totally grokking what you've suggested. Is this summary correct?

1. Stop using classes_array
2. Start using drupal_attributes()

Maybe I'm just reading what I want to read. It seems creating a parallel method of adding an element attribute, i.e. a @class attribute, is getting messy.

Anonymous’s picture

Everet posted the issue, but I agree with him (and with you and Jeff Burnz) that having two ways of adding attributes is too confusing and we should use the attributes array instead.

But in the short term, for the purpose of this patch I think we should continue using classes_array as Jacine suggests. Then we can address the entire classes_array issue as a whole in the other issue, making the change to all the theme functions and templates at the same time.

jessebeach’s picture

Agreed. Solutions in small steps.

scor’s picture

Status: Needs work » Needs review
FileSize
10.12 KB

This patch fixes the two first remarks in #48

+?>
Are we certain that we don't want a variable for this. Makes it easier to modify. Although, I suppose that anyone changing it might likely change the tpl anyway.

Exactly, I thought those who need to override the doctype might also override html.tpl.php. that's a fairly advanced use case IMO.

re content_attributes naming, I think folks are talking about different things (or I'm confused!). @ericduran mentioned html_attributes in the context of the html tag, and I agree with him. so it would like like:

<html<?php print $html_attributes; ?>>

what @Everett Zufelt brought up was in the context of the body tag. (I'm ignoring the class issue here). would everyone be happy with body_attributes? like this

<body class="<?php print $classes; ?>" <?php print $body_attributes;?>>
Anonymous’s picture

Status: Needs review » Needs work

The patch still has references to $head_attributes even though they aren't used, which Everett mentioned in his review.

I agree with your thinking on html_attributes and body_attributes, how about another patch with those added?

scor’s picture

Status: Needs work » Needs review
FileSize
9.48 KB

removed remainings of $head_attributes and implemented the html_attributes and body_attributes variables.

scor’s picture

added better documentation for template_process_html()

Status: Needs review » Needs work
Issue tags: -RDFa, -Framework Initiative, -html5, -sprint

The last submitted patch, convert_html-tpl-php_to-HTML5-1077566-61.patch, failed testing.

ericduran’s picture

Status: Needs work » Needs review
ericduran’s picture

ericduran’s picture

Status: Needs review » Needs work

Ah, this is so much nicer than whats in there now.

We need test for testing the attributes.

ericduran’s picture

+++ b/modules/rdf/rdf.moduleundefined
@@ -461,6 +461,19 @@ function rdf_process(&$variables, $hook) {
+ * Implements MODULE_preprocess_HOOK()

Shouldn't this be Implements hook_process_HOOK().

+++ b/includes/theme.incundefined
@@ -2480,6 +2481,10 @@ function template_process_page(&$variables) {
+  $variables['html_attributes'] = $variables['html_attributes_array'] ? drupal_attributes($variables['html_attributes_array']) : '';
+  $variables['body_attributes'] = $variables['body_attributes_array'] ? drupal_attributes($variables['body_attributes_array']) : '';

We don't need to check, we could just change it to drupal_attributes($variables['html_attattributes_array']

-19 days to next Drupal core point release.

scor’s picture

Status: Needs work » Needs review
FileSize
11.56 KB

Thanks Eric for the review!

Shouldn't this be Implements hook_process_HOOK().

I refactored this function so that it makes more sense to be in preprocess, by using an array instead of imploding directly: drupal_attributes() takes care of that. also fixed the second remark.

re tests, there does not seem to be a place where the generic attributes_array, content_attributes_array, etc. are tested, so I created a test of my own for the html.tpl.php attributes.

ericduran’s picture

Status: Needs review » Needs work
+++ b/modules/simpletest/tests/theme.testundefined
@@ -451,3 +451,31 @@ class ThemeHtmlTag extends DrupalUnitTestCase {
+  /**
+   * Test that the theme system can generate output when called by hook_init().

This comment feels out of place to me. Maybe I'm missing something.

+++ b/modules/simpletest/tests/theme_test.moduleundefined
@@ -104,3 +104,11 @@ function _theme_test_suggestion() {
+/**
+ * Implements MODULE_preprocess_HOOK()

I'm still confused if this is the right comment block for this hook. Shouldn't it be hook_preprocess_HOOK.

The rest seems good to me.

-22 days to next Drupal core point release.

scor’s picture

Status: Needs work » Needs review
FileSize
11.55 KB

Fixed documentation issues pointed out by @ericduran.

Jacine’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. Thank you @scor!

catch’s picture

Title: Convert html.tpl.php to HTML5 » Change notification for: Convert html.tpl.php to HTML5
Priority: Normal » Critical
Status: Reviewed & tested by the community » Active

This looks great, nice to see the RDF cleanup included. Committed/pushed to 8.x.

Do we have a change notification for any of this yet? It'd be good to get one started up if not.

scor’s picture

Thanks @catch! did you also mean to patch number.module?

webchick’s picture

OH YEAH!!!!!!!!!!!!!!!!! GREAT work on this folks!!!!!!!

tim.plunkett’s picture

Status: Active » Needs work

Shouldn't this line come out? Follow-up issue or in here? It's the only remaining mention of grddl left in D8.

+++ b/modules/system/html.tpl.phpundefined
@@ -9,7 +9,8 @@
  * - $grddl_profile: A GRDDL profile allowing agents to extract the RDF data.
scor’s picture

Status: Needs work » Needs review
FileSize
675 bytes

good point @tim.plunkett. I'm also removing the $rdf_namespaces from the docs since it's handled up stream now...

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

I only caught that because pronouncing GRDDL always made me chuckle. Griddle? Girdle?

catch’s picture

Status: Reviewed & tested by the community » Active

@scor, that was #1275978: The thousand_separator for numeric fields should default to '' (nothing) instead of ' ' (space). which I'd intended to commit as well last night, but obviously not all at once..

Committed the followup.

Back to active for the change request.

xjm’s picture

+++ b/includes/common.incundefined
@@ -249,25 +249,9 @@ function drupal_get_breadcrumb() {
- * This function can be called as long the headers aren't sent. Pass no
+ * This function can be called as long as the headers aren't sent. Pass no

Shame on whoever snuck in this comment cleanup. You broke my patch and gave me a merge conflict. :)

rupl’s picture

Status: Active » Fixed
Issue tags: -sprint

Change notice has been created at http://drupal.org/node/1328756

catch’s picture

Priority: Critical » Normal
scor’s picture

Issue tags: +RDFa 1.1

adding tag to track RDFa 1.1 issues.

catch’s picture

Title: Change notification for: Convert html.tpl.php to HTML5 » Convert html.tpl.php to HTML5
Gábor Hojtsy’s picture

Noticed this patch did not convert xml:lang to lang on the way (but reading the HTML 5 spec sounds like it should have done that). So opened a followup (now bug) report for this: #1330922: Drupal 8 HTML 5 page template should use lang not xml:lang.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

larjohn’s picture

@scor:

+function rdf_preprocess_html(&$variables) {
+  // Adds RDF namespace prefix bindings in the form of an RDFa 1.1 prefix
+  // attribute inside the html element.
+  $prefixes = array();
+  foreach(rdf_get_namespaces() as $prefix => $uri) {
+    $variables['html_attributes_array']['prefix'][] = $prefix . ': ' . $uri . "\n";
+  }

this does not validate on W3C validator, because of the "\n"

If you replace it with a regular space, it works.

Is that in par with the specification, or we should report it there?

scor’s picture

@larjohn please file a new issue so we can look into it there.