MDL-27550 workshop: fixed XHTML strictness of H3 and A combo
authorDavid Mudrak <david@moodle.com>
Tue, 2 Aug 2011 21:28:52 +0000 (23:28 +0200)
committerDavid Mudrak <david@moodle.com>
Tue, 2 Aug 2011 21:34:04 +0000 (23:34 +0200)
H3 is block level element while A is in-line element in XHTML.
Credit goes to Sam Hemelryk for spotting this during the peer-review.

mod/workshop/renderer.php

index d0053bb..955a171 100644 (file)
@@ -92,14 +92,14 @@ class mod_workshop_renderer extends plugin_renderer_base {
         $o .= $this->output->container_start($classes);
         $o .= $this->output->container_start('header');
 
-        $title = $this->output->heading(format_string($submission->title), 3, 'title');
+        $title = format_string($submission->title);
 
         if ($this->page->url != $submission->url) {
-            $o .= html_writer::link($submission->url, $title);
-        } else {
-            $o .= $title;
+            $title = html_writer::link($submission->url, $title);
         }
 
+        $o .= $this->output->heading($title, 3, 'title');
+
         if (!$anonymous) {
             $author             = new stdclass();
             $author->id         = $submission->authorid;