diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce 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 '')
-rw-r--r--source/html.h5
1 file changed, 3 insertions, 2 deletions
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);