mirror of https://gitlab.com/bashrc2/epicyon
Fix underscore within hashtag
parent
794fdbb987
commit
46dce1898a
2
tests.py
2
tests.py
|
@ -5328,6 +5328,8 @@ def _test_valid_hash_tag():
|
|||
assert valid_hash_tag('ThisIsVälid')
|
||||
assert valid_hash_tag('यहमान्यहै')
|
||||
assert valid_hash_tag('한국어')
|
||||
assert valid_hash_tag('테스트')
|
||||
assert valid_hash_tag('테_스트')
|
||||
assert not valid_hash_tag('this-is-invalid')
|
||||
assert not valid_hash_tag('ThisIsNotValid!')
|
||||
assert not valid_hash_tag('#ThisIsAlsoNotValid')
|
||||
|
|
2
utils.py
2
utils.py
|
@ -1874,7 +1874,7 @@ def _is_valid_language(text: str) -> bool:
|
|||
for lang_name, lang_range in natural_languages.items():
|
||||
ok_lang = True
|
||||
for char in text:
|
||||
if char.isdigit():
|
||||
if char.isdigit() or char == '_':
|
||||
continue
|
||||
if ord(char) not in range(lang_range[0], lang_range[1]):
|
||||
ok_lang = False
|
||||
|
|
Loading…
Reference in New Issue