Fix incorrect character count (#340)

pull/342/head
TAKAHASHI Shuuji 2023-01-01 12:17:48 +09:00 zatwierdzone przez GitHub
rodzic 6028232d3d
commit 6e34313aaf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -29,7 +29,6 @@ class Compose(FormView):
widget=forms.Textarea(
attrs={
"autofocus": "autofocus",
"maxlength": Config.lazy_system_value("post_length"),
"placeholder": "What's on your mind?",
},
)
@ -62,7 +61,8 @@ class Compose(FormView):
"_"
] = f"""
on load or input
set characters to my.value.trim().length
-- Unicode-aware counting to match Python
set characters to Array.from(my.value.trim()).length
put {Config.system.post_length} - characters into #character-counter
if characters > {Config.system.post_length} then