Comment 0 for bug 588679

Revision history for this message
David Coles (dcoles) wrote :

When you get the value of a text box in IE8, newlines contain CRLFs.

This will cause syntax errors when submitting or running this code in a console since it's an error to mix CRLF with LF in a Python file. Using jQuery's text() function seems to make things worse by turning a CRLF into just a CR (does anything use that anymore!).

Whilst we could silently transcode CRLFs to LFs inside the IVLE server it seems to be a bad idea when people might explicitly want a CRLF. Thus I suggest we contain all newline silliness inside the webclient and mandate that new lines should be sent as a single LF to the server.

This means that you need to do a `replace('\r\n', '\n').replace('\r', '\n')` on all content read from a multi-line textbox before it's sent to the server.