From 0559036fb6e64ec25d3a1ff707925fe1cdce5f05 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 12:53:16 -1000 Subject: 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. --- source/html.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/html.h') diff --git a/source/html.h b/source/html.h index 095804c..c6c0e19 100644 --- a/source/html.h +++ b/source/html.h @@ -55,8 +55,9 @@ extern void html_attrf(const char *format, ...); extern void html_txt(const char *txt); /* - * Escape at most len bytes of txt. The return is what is left of that budget, - * and a caller prints an ellipsis when it comes back negative. + * Escape at most len bytes of txt, cutting short of a character the budget + * would split. The return is what is left of that budget, and a caller prints + * an ellipsis when it comes back negative. */ extern ssize_t html_ntxt(const char *txt, size_t len); -- cgit