diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Cut text between characters, never inside one
The index description was cut at a byte count, which could split a
multibyte character and leave an invalid sequence on the page. Commit
subjects already backed up to the start of the character, so html_ntxt
now does that for every caller.
Diffstat (limited to 'tests/t0101-index.sh')
| -rwxr-xr-x | tests/t0101-index.sh | 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 14 insertions, 0 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index adad6be..e433beb 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -53,4 +53,18 @@ test_expect_success 'the feed link encodes the repository and the branch' ' grep "title=.Atom feed. href=.http://example.org/foo%2Bbar/atom/?h=1%2B2." tmp ' +# The description limit counts bytes, so a cut has to land between +# characters rather than leave half of one on the page. +test_expect_success 'a cut description keeps whole characters' ' + { + echo "max-repodesc-length=10" && + sed "s/^cache-size=.*/cache-size=0/" cgitrc && + echo "repo.url=mb" && + echo "repo.path=$PWD/repos/foo/.git" && + echo "repo.desc=日本語の説明文です" + } >descrc && + CGIT_CONFIG="$PWD/descrc" QUERY_STRING="url=" cgit >tmp && + grep ">日本語\.\.\.</a>" tmp +' + test_done |
