Improve escaping in code response.
Merge pull request #3981 from edx/alex/fix_matlab_check

Improve escaping in code response.