diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/issues_controller.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 914dc8400..d627f712d 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -223,10 +223,13 @@ class IssuesController < ApplicationController user = @issue.author text = @issue.description end - content = "#{ll(Setting.default_language, :text_user_wrote, user)}\\n> " - content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n" + # Replaces pre blocks with [...] + text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]') + content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> " + content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + render(:update) { |page| - page.<< "$('notes').value = \"#{content}\";" + page.<< "$('notes').value = \"#{escape_javascript content}\";" page.show 'update' page << "Form.Element.focus('notes');" page << "Element.scrollTo('update');" |