From 465f429f7f1e12601084f8446fadebc55ab9de6f Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 24 Oct 2026 09:17:42 -1000 Subject: Set every monospace element in the theme font Only some pre elements named --font-mono, so code in a readme took the browser's own font, Courier in Chrome and Safari, rather than a theme's. --- tests/t0005-markup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/t0005-markup.sh') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 829c839..5d802a7 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -90,6 +90,14 @@ test_expect_success 'the blob, blame and about pages open with their own contain grep "
" tmp ' +# A browser gives these elements a monospace font of its own, which would +# otherwise win over the one a theme sets through --font-mono. +test_expect_success 'every monospace element takes the theme font' ' + sed -n "/^div#cgit code,$/,/^}/p" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" >rule && + grep "^div#cgit pre,$" rule && + grep "^ font-family: var(--font-mono);$" rule +' + test_expect_success 'the stylesheet and the script name only the current hooks' ' ! grep "_dark\|#summary\|ul.pager\|td:empty" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" && grep "window.cgit.updateAges" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" && -- cgit 2.9.1