mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-09-02 06:20:50 +00:00
fix(wheelofnames): pad spoiler with figure space to match letter width in proportional font
This commit is contained in:
@@ -71,9 +71,11 @@ func wheelResultCaption(options []string, winner int) string {
|
||||
return `Result: <span class="tg-spoiler">` + html.EscapeString(result) + `</span>`
|
||||
}
|
||||
|
||||
// Non-breaking space: regular spaces at the caption edges get trimmed by
|
||||
// Telegram, which would shrink the spoiler and reveal the winner's length.
|
||||
const wheelCaptionPad = "\u00a0"
|
||||
// Figure space: blank, non-breaking, and as wide as a digit, so in
|
||||
// Telegram's proportional font one pad char roughly matches one letter;
|
||||
// a regular space is far narrower and the spoiler width would still hint
|
||||
// at the winner's length.
|
||||
const wheelCaptionPad = "\u2007"
|
||||
|
||||
// padWheelResultCaption prefixes shorter winners with blank padding so every
|
||||
// option renders a spoiler of equal length; otherwise the spoiler width
|
||||
|
||||
Reference in New Issue
Block a user