Documentation
¶
Overview ¶
Package text holds the small string-shortening helpers that were copied, subtly differently, into half a dozen packages. They share one rule that is load-bearing here: a truncation must land on a rune boundary. Several of these strings end up in a vault markdown file, and a byte slice through a multibyte rune writes invalid UTF-8 into truth (invariant 1).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ellipsize ¶
Ellipsize shortens s to at most n runes, appending "…" when it had to cut so the reader can see the value is not complete (invariant 3). The "…" counts toward n, so the result is never wider than n runes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.