Correctly parse multi-line error messages in the editor.

This commit is contained in:
Vicky Chijwani 2014-05-16 01:41:26 +05:30
parent f32a0ca963
commit 0a14681e7b

View file

@ -17,7 +17,7 @@ module.exports = class ProblemAlertView extends View
getRenderData: (context={}) ->
context = super context
format = (s) -> s?.replace('<', '&lt;').replace('>', '&gt;').replace("\n", "<br>")
format = (s) -> s?.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, '<br>')
context.message = format @problem.aetherProblem.message
context.hint = format @problem.aetherProblem.hint
context