summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 06:38:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 06:38:19 +0000
commitc0a638721cc00418627ed58b0f151fc777d4f50b (patch)
tree36ebc130a4e85f95e85770288335853aee8a69c2 /lib
parentb9cbfb2846183d71e94b2f035ba8ba7bdf3ec7f7 (diff)
downloadredmine-c0a638721cc00418627ed58b0f151fc777d4f50b.tar.gz
redmine-c0a638721cc00418627ed58b0f151fc777d4f50b.zip
Text may unexpectedly be enclosed in pre tags when an issue is created via HTML email (#31232).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@18268 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/wiki_formatting/html_parser.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/wiki_formatting/html_parser.rb b/lib/redmine/wiki_formatting/html_parser.rb
index aa4891ce0..80f15b72c 100644
--- a/lib/redmine/wiki_formatting/html_parser.rb
+++ b/lib/redmine/wiki_formatting/html_parser.rb
@@ -30,13 +30,13 @@ module Redmine
}
def self.to_text(html)
- html = html.gsub(/[\n\r]/, '').squeeze(' ')
+ html = html.gsub(/[\n\r]/, ' ')
doc = Loofah.document(html)
doc.scrub!(WikiTags.new(tags))
doc.scrub!(:newline_block_elements)
- Loofah.remove_extraneous_whitespace(doc.text).strip
+ Loofah.remove_extraneous_whitespace(doc.text).strip.squeeze(' ').gsub(/^ +/, '')
end
class WikiTags < ::Loofah::Scrubber