mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 16:03:11 +08:00

This improves the `TextSentinel` so that we don't consider CJK text as being uppercase and thus failing the validator. It also optimizes the entropy computation by using native ruby `.bytes` to get all the bytes from the text. It also tweaks the `seems_pronounceable?` and `seems_unpretentious?` check to use the `\p{Alnum}` unicode regexp group to account for non-latin languages. Reference - https://meta.discourse.org/t/body-seems-unclear-error-when-users-are-typing-in-chinese/88715 Inspired by https://github.com/discourse/discourse/pull/27900 Co-authored-by: Paulo Magalhaes <mentalstring@gmail.com>