mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Fix regex for invalid placeholders (#7738)
This issue added some false positives to the list and broke the string synchronization.
This commit is contained in:
committed by
GitHub
parent
3c3e8f8f6f
commit
84a907d906
@@ -47,8 +47,9 @@ forbiddenTerms = {
|
||||
# %s %d %f ... -> simple conversion
|
||||
# %1$s %2$d ... -> positional
|
||||
# %.2f %1$.2f -> optional precision
|
||||
# It also contains a trailing dot to catch cases like "%s." which are valid placeholders but will be flagged as invalid by the regex.
|
||||
_VALID_PLACEHOLDER = re.compile(
|
||||
r'%(?:\d+\$)?(?:\.\d+)?[a-zA-Z]'
|
||||
r'%(?:\d+\$)?(?:\.\d+)?[a-zA-Z]\.*'
|
||||
)
|
||||
|
||||
# Grab each candidate token: a '%' plus the run of chars that could belong to a
|
||||
|
||||
Reference in New Issue
Block a user