mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 08:41:00 +00:00
Fix incorrect character count (#340)
This commit is contained in:
parent
6028232d3d
commit
6e34313aaf
1 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,6 @@ class Compose(FormView):
|
||||||
widget=forms.Textarea(
|
widget=forms.Textarea(
|
||||||
attrs={
|
attrs={
|
||||||
"autofocus": "autofocus",
|
"autofocus": "autofocus",
|
||||||
"maxlength": Config.lazy_system_value("post_length"),
|
|
||||||
"placeholder": "What's on your mind?",
|
"placeholder": "What's on your mind?",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -62,7 +61,8 @@ class Compose(FormView):
|
||||||
"_"
|
"_"
|
||||||
] = f"""
|
] = f"""
|
||||||
on load or input
|
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
|
put {Config.system.post_length} - characters into #character-counter
|
||||||
|
|
||||||
if characters > {Config.system.post_length} then
|
if characters > {Config.system.post_length} then
|
||||||
|
|
Loading…
Reference in a new issue