lib/theme_check/theme_file.rb in theme-check-1.9.2 vs lib/theme_check/theme_file.rb in theme-check-1.10.0
- old
+ new
@@ -43,10 +43,12 @@
@source, @version = @storage.read_version(@relative_path)
else
@source = @storage.read(@relative_path)
end
@eol = @source.include?("\r\n") ? "\r\n" : "\n"
- @source = @source.gsub("\r\n", "\n")
+ @source = @source
+ .gsub(/\r(?!\n)/, "\r\n") # fix rogue \r without followup \n with \r\n
+ .gsub("\r\n", "\n")
end
def json?
false
end