diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-21 09:45:21 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-21 09:45:21 +0300 |
| commit | ed549aaa423f10d15171c678303fea679d997220 (patch) | |
| tree | 811ec27c8393cdb2ddf38411997988b1f075f491 /tests/cli.sh | |
| parent | 6e6cc0b44fce859669bd967c5d98a39074d8251c (diff) | |
Fix W3C HTML validation errors in generated pages; release 0.10.10.10.1
Every shuriken-generated page failed W3C validation. Fixed across the
templates and the bash thumbnail builders so all page categories (splash,
gallery, photo view, details, stats overview, stats filter mini-albums and
redirect stubs) validate cleanly:
- Add <!DOCTYPE html>, <html lang="en"> and <meta charset="utf-8"> to the
header, splash and redirect templates.
- Drop the obsolete type="text/css" on <style> and border='0' on <img>.
- Fix invalid CSS "margin: 2 auto" -> "margin: 2px auto".
- Add required alt attributes to every <img> (splash, thumbnails, views).
- Replace the obsolete name attribute on <a> thumbnail anchors with id (in
album-render.source.sh and stats-filter-album.source.sh, where the markup
is actually built, plus preview.tmpl for consistency).
- Give redirect stubs a <title>; drop trailing slashes on void elements.
Updated the affected cli.sh assertions and rebuilt bin/shuriken.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests/cli.sh')
| -rwxr-xr-x | tests/cli.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/cli.sh b/tests/cli.sh index 006967b..436970a 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -693,8 +693,8 @@ test_generate_no_shuffle_override_uses_sorted_order() { page_html=$(<"$TEST_TMPDIR/dist/page-1.html") test::assert_contains_before \ - "name='01-landscape.jpg'" \ - "name='06-extra.jpg'" \ + "id='01-landscape.jpg'" \ + "id='06-extra.jpg'" \ "$page_html" test::assert_path_absent "$sort_log" test::teardown @@ -2975,7 +2975,7 @@ test_integration_generates_album_outputs_and_cleans() { page_html=$(<"$TEST_TMPDIR/dist/page-1.html") details_html=$(<"$TEST_TMPDIR/dist/1-1-details.html") top_index_html=$(<"$TEST_TMPDIR/dist/index.html") - test::assert_contains "name='04 filename with spaces.jpg'" \ + test::assert_contains "id='04 filename with spaces.jpg'" \ "$(<"$TEST_TMPDIR/dist/page-2.html")" test::assert_contains 'Next 2 pictures' "$page_html" test::assert_contains \ @@ -3009,7 +3009,7 @@ test_integration_generates_album_outputs_and_cleans() { test::assert_contains 'Enter album' "$top_index_html" test::assert_contains 'href="page-1.html"' "$top_index_html" test::assert_contains \ - '<img class="splash-photo" src="./photos/' \ + '<img class="splash-photo" alt="Integration album" src="./photos/' \ "$top_index_html" test::assert_not_contains '<script' "$top_index_html" test::assert_not_contains 'javascript:' "$top_index_html" @@ -3467,7 +3467,7 @@ test_refresh_splash_rewrites_only_index_from_existing_assets() { after_metadata=$(<"$TEST_TMPDIR/dist/shuriken.json") test::assert_contains 'Refreshed splash page' "$output" - test::assert_contains '<img class="splash-photo" src="./photos/' \ + test::assert_contains '<img class="splash-photo" alt="Refresh splash album" src="./photos/' \ "$after_index" if [ "$before_index" = "$after_index" ]; then echo 'FAIL: expected --refresh-splash to choose a new splash image' >&2 @@ -4690,7 +4690,7 @@ BASH html=$(cat "$s/camera-canon-eos-5d/index.html") test::assert_contains 'href="1.html"' "$html" test::assert_contains 'class="thumb ' "$html" - test::assert_contains 'src="../../thumbs/a.jpg" />' "$html" + test::assert_contains 'src="../../thumbs/a.jpg"></a>' "$html" test::assert_contains 'href="2.html"' "$html" # Heading shows the (trusted) camera label and a back-to-stats link. test::assert_contains 'Canon EOS 5D' "$html" @@ -5387,12 +5387,12 @@ test_generate_escapes_html_values() { "$page_html" test::assert_contains "url(\"./blurs/$css_photo\")" "$top_index_html" test::assert_contains "src=\"./photos/$photo_html\"" "$top_index_html" - test::assert_contains "name='$photo_html'" "$page_html" + test::assert_contains "id='$photo_html'" "$page_html" test::assert_contains "src='./thumbs/$photo_html'" "$page_html" test::assert_contains '&"'.tar' "$page_html" test::assert_contains "href=\"page-1.html#$photo_html\"" "$view_html" test::assert_contains 'href="1-1-details.html">Details</a>' "$view_html" - test::assert_contains "href ='./photos/$photo_html'" "$view_html" + test::assert_contains "href='./photos/$photo_html'" "$view_html" test::assert_contains \ "href=\"$original_basepath_html/$photo_html\"" \ "$view_html" |
