Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

escaping javascript, important for functions containing single quote #52

Merged
merged 1 commit into from Jul 7, 2012
Jump to file or symbol
Failed to load files and symbols.
+3 −3
Split
@@ -9,8 +9,8 @@ $(document).ready(function() {
varId: <%= @function.id %>,
library: "<%= @function.library.name %>",
version: "<%= @function.library.version %>",
- editExampleFormHTML: '<%= (render :partial => '/examples/edit_example_form').gsub("\n", "")%>',
- editCommentFormHTML: '<%= (render :partial => '/comments/edit_comment_form').gsub("\n", "")%>',
+ editExampleFormHTML: '<%= escape_javascript(render :partial => '/examples/edit_example_form').gsub("\n", "")%>',
+ editCommentFormHTML: '<%= escape_javascript(render :partial => '/comments/edit_comment_form').gsub("\n", "")%>',
})
})
</script>
@@ -3,7 +3,7 @@
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
CD.Examples.init({
- editExampleFormHTML: '<%= (render :partial => '/examples/edit_example_form').gsub("\n", "")%>'
+ editExampleFormHTML: '<%= escape_javascript(render :partial => '/examples/edit_example_form').gsub("\n", "")%>'
})
})
</script>