lib/potato/helpers/string.rb in potato-0.0.14 vs lib/potato/helpers/string.rb in potato-0.0.15
- old
+ new
@@ -4,10 +4,10 @@
# Helpers for String.
module String
# Convert numeric and hexadecimal HTML entities to Unicode codepoints.
# @return [String]
def decode_entities
- gsub(/&#(\d+);/){[$1.to_i].pack("U*")}.gsub(/&#x([0-9a-fA-F]+);/u){[$1.to_i(16)].pack("U*")}
+ gsub(/&#(\d+);/){[$1.to_i].pack("U*")}.gsub(/&#x([0-9a-fA-F]+);/){[$1.to_i(16)].pack("U*")}
end
# Convert Unicode codepoints to numeric HTML entities.
# @return [String]
def encode_entities
\ No newline at end of file