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
http://code.google.com/p/reviewboard/issues/detail?id=1636

*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?
http://demo.reviewboard.org/r/50/diff/#index_header

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

Firefox reports: GET
http://demo.reviewboard.org/r/50/reviews/draft/inline-form/
GET http://demo.reviewboard.org/r/50/reviews/draft/inline-form/
        
200 OK
                231ms   
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
b/reviewboard/templates/reviews/review_draft_inline_form.h
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 @@
                 null,
 {% endif %}
                 {{comment.first_line}}, {{comment.last_line}},
-                "{{comment.text}}"));
+                "{{comment.text|escapejs}}"));
         $("#edit-diff-comment-{{comment.id}}").click(function() {
             editor.inlineEditor("startEdit");
         });



--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to