blog

Source files for chris.bracken.jp
git clone https://git.bracken.jp/blog.git
Log | Files | Refs | Submodules | README | LICENSE

commit 7b8ae13059b65a41c03afc48cea6ff4624832757
parent 75be1bb4e2f0d0933c895838ff4a508830410699
Author: Chris Bracken <chris@bracken.jp>
Date:   Wed, 20 Sep 2023 18:56:18 -0700

Use explicit non-breaking space for decayed chars

Diffstat:
Mdecay.py | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/decay.py b/decay.py @@ -20,7 +20,7 @@ def decay(text, maintain_fraction): remove_count = int((1 - maintain_fraction) * length) for i in range(0, remove_count): pos = random.randrange(length) - chars[pos] = " " + chars[pos] = "\u00a0" # non-breaking space. return "".join(chars)