mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 22:52:32 -05:00
add field mask
This commit is contained in:
1 parent
4116746be3
commit
23dcd62672
5 files changed
+40
-8
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
module TextUtils
|
||||
RTL_REGEXP = /[\p{Hebrew}\p{Arabic}]/
|
||||
MASK_REGEXP = /[^\s\-_\[\]\(\)\+\?\.\,]/
|
||||
MASK_SYMBOL = 'X'
|
||||
|
||||
module_function
|
||||
|
||||
@@ -13,6 +15,10 @@ module TextUtils
|
||||
false
|
||||
end
|
||||
|
||||
def mask_value(text)
|
||||
text.to_s.gsub(MASK_REGEXP, MASK_SYMBOL)
|
||||
end
|
||||
|
||||
def maybe_rtl_reverse(text)
|
||||
if text.match?(RTL_REGEXP)
|
||||
TwitterCldr::Shared::Bidi
|
||||
|
||||
Reference in new issue
Block a user