Skip to content

Commit 28c2a35

Browse files
committed
Merge branch 'jy/gitweb-xhtml5'
Update the doctype written in gitweb output to xhtml5. * jy/gitweb-xhtml5: gitweb: switch to an XHTML5 DOCTYPE
2 parents 9e496ff + 0e1a85c commit 28c2a35

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

gitweb/gitweb.perl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4219,7 +4219,10 @@ sub git_header_html {
42194219
my $mod_perl_version = $ENV{'MOD_PERL'} ? " $ENV{'MOD_PERL'}" : '';
42204220
print <<EOF;
42214221
<?xml version="1.0" encoding="utf-8"?>
4222-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4222+
<!DOCTYPE html [
4223+
<!ENTITY nbsp "&#xA0;">
4224+
<!ENTITY sdot "&#x22C5;">
4225+
]>
42234226
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
42244227
<!-- git web interface version $version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
42254228
<!-- git core binaries version $git_version -->

t/t9502-gitweb-standalone-parse-output.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,18 @@ test_expect_success 'no http-equiv="content-type" in XHTML' '
220220
no_http_equiv_content_type "p=.git;a=tree"
221221
'
222222

223+
proper_doctype() {
224+
gitweb_run "$@" &&
225+
grep -F "<!DOCTYPE html [" gitweb.body &&
226+
grep "<!ENTITY nbsp" gitweb.body &&
227+
grep "<!ENTITY sdot" gitweb.body
228+
}
229+
230+
test_expect_success 'Proper DOCTYPE with entity declarations' '
231+
proper_doctype &&
232+
proper_doctype "p=.git" &&
233+
proper_doctype "p=.git;a=log" &&
234+
proper_doctype "p=.git;a=tree"
235+
'
236+
223237
test_done

0 commit comments

Comments
 (0)