lib/asciidoctor/helpers.rb in asciidoctor-1.5.3 vs lib/asciidoctor/helpers.rb in asciidoctor-1.5.4
- old
+ new
@@ -61,11 +61,11 @@
# data - a String Array of lines to normalize
#
# returns a String Array of normalized lines
def self.normalize_lines_array data
return [] if data.empty?
-
+
# NOTE if data encoding is UTF-*, we only need 0..1
leading_bytes = (first_line = data[0])[0..2].bytes.to_a
if COERCE_ENCODING
utf8 = ::Encoding::UTF_8
if (leading_2_bytes = leading_bytes[0..1]) == BOM_BYTES_UTF_16LE
@@ -97,10 +97,10 @@
# is made to encode from the specified encoding to UTF-8.
#
# data - a String of lines to normalize
#
# returns a String Array of normalized lines
- def self.normalize_lines_from_string data
+ def self.normalize_lines_from_string data
return [] if data.nil_or_empty?
if COERCE_ENCODING
utf8 = ::Encoding::UTF_8
# NOTE if data encoding is UTF-*, we only need 0..1