`ScriptEditorService:UpdateSourceAsync` does not work when only line ending changes

ScriptEditorService:UpdateSourceAsync does not update Script.Source when only line ending changes, e.g. from Windows’ CRLF to Unix’s LF.

Repro:

local ScriptEditorService = game:GetService("ScriptEditorService")

local CRLF = "print(1)\r\nprint(2)"
local LF = "print(1)\nprint(2)"

local script = Instance.new("Script")

script.Source = CRLF

ScriptEditorService:UpdateSourceAsync(script, function()
	return LF
end)

print(script.Source == LF) -- false, expected true
3 Likes

This is affecting me too! Please Roblox fix this, or make it so that line ending differences are automatically cleared so we don’t have to deal with these problems manually ourselves!!

1 Like