]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Always produce HTML5 doctype and new attributes, but not new elements
authorSimon McVittie <smcv@debian.org>
Thu, 16 Oct 2014 10:04:53 +0000 (11:04 +0100)
committerSimon McVittie <smcv@debian.org>
Thu, 16 Oct 2014 10:04:53 +0000 (11:04 +0100)
According to caniuse.com, a significant fraction of Web users are
still using Internet Explorer versions that do not support HTML5
sectioning elements. However, claiming we're XHTML 1.0 Strict
means we can't use features invented in the last 12 years, even if
they degrade gracefully in older browsers (like the role and placeholder
attributes).

This means our output is no longer valid according to any particular
DTD. Real browsers and other non-validator user-agents have never
cared about DTD compliance anyway, so I don't think this is a real loss.

IkiWiki.pm
IkiWiki/Plugin/mirrorlist.pm
debian/control
t/html.t [deleted file]
templates/googleform.tmpl
templates/page.tmpl
templates/searchform.tmpl

index 1043ef4024ba5994d773b524103c46baad50b084..dfe89ad32a30adf6b681d77bea12dc7e7e64539b 100644 (file)
@@ -274,7 +274,7 @@ sub getsetup () {
        html5 => {
                type => "boolean",
                default => 0,
-               description => "generate HTML5?",
+               description => "use elements new in HTML5 like <section>?",
                advanced => 0,
                safe => 1,
                rebuild => 1,
index b7e53248500d8a31337e582e81d24a5870ebb074..5afd9ec1a8aca4b3ca2275dbf5d8dfaf77500690 100644 (file)
@@ -53,7 +53,7 @@ sub pagetemplate (@) {
 
 sub mirrorlist ($) {
        my $page=shift;
-       return ($config{html5} ? '<nav id="mirrorlist">' : '<div>').
+       return ($config{html5} ? '<nav' : '<div').' id="mirrorlist">'.
                (keys %{$config{mirrorlist}} > 1 ? gettext("Mirrors") : gettext("Mirror")).
                ": ".
                join(", ",
index 5b9d55c4d60aebbfe1d2ad7e3efce4597b86f688..c0e6d7d027865935dbae09a0ffa196634735ebc4 100644 (file)
@@ -5,7 +5,7 @@ Build-Depends: perl, debhelper (>= 9)
 Build-Depends-Indep: dpkg-dev (>= 1.9.0), libxml-simple-perl,
   libtext-markdown-discount-perl,
   libtimedate-perl, libhtml-template-perl,
-  libhtml-scrubber-perl, wdg-html-validator,
+  libhtml-scrubber-perl,
   libhtml-parser-perl, liburi-perl (>= 1.36), perlmagick, po4a (>= 0.34),
   libfile-chdir-perl, libyaml-libyaml-perl, python-support, librpc-xml-perl,
   libcgi-session-perl, ghostscript,
diff --git a/t/html.t b/t/html.t
deleted file mode 100755 (executable)
index 84c561f..0000000
--- a/t/html.t
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Test::More;
-
-my @pages;
-
-BEGIN {
-       @pages=qw(index features news plugins/map security);
-       if (system("command -v validate >/dev/null") != 0) {
-               plan skip_all => "html validator not present";
-       }
-       else {
-               plan(tests => int @pages + 2);
-       }
-       use_ok("IkiWiki");
-}
-
-# Have to build the html pages first.
-# Note that just building them like this doesn't exersise all the possible
-# html that can be generated, in particular it misses some of the action
-# links at the top, etc.
-ok(system("make >/dev/null") == 0);
-
-foreach my $page (@pages) {
-        print "# Validating $page\n";
-       ok(system("validate html/$page.html") == 0);
-}
-
-# TODO: validate form output html
index b1c3078fb15df107c3f0a7fe1d70df9b66b2749e..155a08155198224b6202ceb1c150f6881752fef3 100644 (file)
@@ -3,6 +3,6 @@
  <div>
   <input name="sitesearch" value="<TMPL_VAR URL>" type="hidden" />
   <input name="q" value="" id="searchbox" size="16" maxlength="255" type="text"
-  <TMPL_IF HTML5>placeholder="search"</TMPL_IF> />
+    placeholder="search" />
  </div>
 </form>
index c709c4f851678a7adfea7eeacfd4246fbe136018..45235cef86da260fa8defeedf6742bcfbd8fa299 100644 (file)
@@ -1,9 +1,5 @@
-<TMPL_IF HTML5><!DOCTYPE html>
+<!DOCTYPE html>
 <html>
-<TMPL_ELSE><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-</TMPL_IF>
 <head>
 <TMPL_IF DYNAMIC>
 <TMPL_IF FORCEBASEURL><base href="<TMPL_VAR FORCEBASEURL>" /><TMPL_ELSE>
 
 <div id="pagebody">
 
-<TMPL_IF HTML5><section id="content" role="main"><TMPL_ELSE><div id="content"></TMPL_IF>
+<TMPL_IF HTML5><section<TMPL_ELSE><div</TMPL_IF> id="content" role="main">
 <TMPL_VAR CONTENT>
 <TMPL_IF HTML5></section><TMPL_ELSE></div></TMPL_IF>
 
 
 <TMPL_UNLESS DYNAMIC>
 <TMPL_IF COMMENTS>
-<TMPL_IF HTML5><section id="comments" role="complementary"><TMPL_ELSE><div id="comments"></TMPL_IF>
+<TMPL_IF HTML5><section<TMPL_ELSE><div</TMPL_IF> id="comments" role="complementary">
 <TMPL_VAR COMMENTS>
 <TMPL_IF ADDCOMMENTURL>
 <div class="addcomment">
 
 </div>
 
-<TMPL_IF HTML5><footer id="footer" class="pagefooter" role="contentinfo"><TMPL_ELSE><div id="footer" class="pagefooter"></TMPL_IF>
+<TMPL_IF HTML5><footer<TMPL_ELSE><div</TMPL_IF> id="footer" class="pagefooter" role="contentinfo">
 <TMPL_UNLESS DYNAMIC>
 <TMPL_IF HTML5><nav id="pageinfo"><TMPL_ELSE><div id="pageinfo"></TMPL_IF>
 
index cb65d124ca9d543b762bbfb5e40100e09c5e1436..8cdf745f9a9e1d6b53a19be2780fd76fcae9fbf9 100644 (file)
@@ -1,6 +1,6 @@
 <form method="get" action="<TMPL_VAR SEARCHACTION>" id="searchform">
 <div>
 <input type="text" id="searchbox" name="P" value="" size="16"
-<TMPL_IF HTML5>placeholder="search"</TMPL_IF> />
+  placeholder="search" />
 </div>
 </form>