I want to check cell is changed with data contain multi line in a cell.
The data get from API will contain \r\n as new line. When I open edit mode then focus out (Don’t change the value), the value will auto convert \r\n to \n. It will detect the value has changed
You can check at https://jsfiddle.net/TonyNguyen001/jxgp7vnm/20/
I don’t want to replace \r\n to \n to check value is changed. I just want the value will not convert from \r\n to \n. Is there any way can I do that ?
The newline normalization algorithm is exactly explained in the spec:
To normalize newlines in a string, replace every U+000D CR U+000A LF code point pair with a single U+000A LF code point, and then replace every remaining U+000D CR code point with a U+000A LF code point.
After normalization, there is no way we can tell if the original string contained \r\n or \n. The only thing you can do is to apply some kind of reverse normalization in your user code.