Module: Sanitization::ActiveRecordExtension::InstanceMethods

Defined in:
lib/sanitization/active_record_extension.rb

Overview

module ClassMethods

Constant Summary collapse

MULTIBYTE_WHITE =

Taken from ‘strip_attributes`: github.com/rmm5t/strip_attributes/blob/master/lib/strip_attributes.rb Unicode invisible and whitespace characters. The POSIX character class

:space:

corresponds to the Unicode class Z (“separator”). We also

include the following characters from Unicode class C (“control”), which are spaces or invisible characters that make no sense at the start or end of a string:

U+180E MONGOLIAN VOWEL SEPARATOR
U+200B ZERO WIDTH SPACE
U+200C ZERO WIDTH NON-JOINER
U+200D ZERO WIDTH JOINER
U+2060 WORD JOINER
U+FEFF ZERO WIDTH NO-BREAK SPACE
"\u180E\u200B\u200C\u200D\u2060\uFEFF".freeze
MULTIBYTE_SPACE =
/[[:space:]#{MULTIBYTE_WHITE}]/.freeze
MULTIBYTE_BLANK =
/[[:blank:]#{MULTIBYTE_WHITE}]/.freeze
MULTIBYTE_SUPPORTED =
"\u0020" == " "