lib/axlsx.rb in axlsx-1.3.6 vs lib/axlsx.rb in axlsx-2.0.0
- old
+ new
@@ -125,9 +125,17 @@
s = s.to_s
s = s.capitalize if all_caps
s.gsub(/_(.)/){ $1.upcase }
end
+ # returns the provided string with all invalid control charaters
+ # removed.
+ # @param [String] str The sting to process
+ # @return [String]
+ def self.sanitize(str)
+ str.gsub(CONTROL_CHAR_REGEX, '')
+ end
+
# Instructs the serializer to not try to escape cell value input.
# This will give you a huge speed bonus, but if you content has <, > or other xml character data
# the workbook will be invalid and excel will complain.
def self.trust_input