Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1636 by lonico: unterminated string literal JS error prevents loading diff lines corresponding to comments containing newlines

*NOTE: Do not post confidential information in this bug report.*

What version are you running?
1.5 beta 1 (but also observed on the demo site, 1.5 beta 2)

What's the URL of the page containing the problem?

What steps will reproduce the problem? the diff view, add comment that contains newline characters
(multi<enter>line<enter>comment for instance) the comment, click on "Edit Review"
3.the comment is correctly displayed, but not the context diffs.  It's
spinning forever.

Firefox reports: GET
200 OK
jquery....min.js (line 19)
unterminated string literal
[Break on this error] "multi\n

Google Chrome reports some ILLEGAL error

What is the expected output? What do you see instead?

Inline diffs are not shown.  The spinner spins forever.

What operating system are you using? What browser?

Windows.  Firefox, Google Chrome

Please provide any additional information below.

I'll submit a review, but the diffs are simple, thanks to Django:

diff --git a/reviewboard/templates/reviews/review_draft_inline_form.html
index 06f9259..5452d80 100644
--- a/reviewboard/templates/reviews/review_draft_inline_form.html
+++ b/reviewboard/templates/reviews/review_draft_inline_form.html
@@ -98,7 +98,7 @@
 {% endif %}
                 {{comment.first_line}}, {{comment.last_line}},
-                "{{comment.text}}"));
+                "{{comment.text|escapejs}}"));
         $("#edit-diff-comment-{{}}").click(function() {

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to