Fixed flawed regexp for removing pre blocks when quoting notes (#16353).
Patch by Stephane Lapie. git-svn-id: http://svn.redmine.org/redmine/trunk@12969 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d7729d6d4f
commit
995ae083cd
|
@ -66,7 +66,7 @@ class JournalsController < ApplicationController
|
||||||
text = @issue.description
|
text = @issue.description
|
||||||
end
|
end
|
||||||
# Replaces pre blocks with [...]
|
# Replaces pre blocks with [...]
|
||||||
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
|
text = text.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]')
|
||||||
@content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
@content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||||||
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
|
Loading…
Reference in New Issue