From 6f5ffce7993923bf6568b1d756b7a101f7b75028 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 14 Mar 2011 20:35:36 +0000 Subject: [PATCH] Fixed: line breaks are ignored in quoted text (#6148). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5133 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redcloth3.rb | 4 ++-- lib/redmine/wiki_formatting/textile/formatter.rb | 2 +- .../lib/redmine/wiki_formatting/textile_formatter_test.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index 848aa7042..f4c624437 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -296,11 +296,11 @@ class RedCloth3 < String rip_offtags text no_textile text escape_html_tags text + # need to do this before #hard_break and #blocks + block_textile_quotes text unless @lite_mode hard_break text unless @lite_mode refs text - # need to do this before text is split by #blocks - block_textile_quotes text blocks text end inline text diff --git a/lib/redmine/wiki_formatting/textile/formatter.rb b/lib/redmine/wiki_formatting/textile/formatter.rb index 88d52a6c2..a32e648ec 100644 --- a/lib/redmine/wiki_formatting/textile/formatter.rb +++ b/lib/redmine/wiki_formatting/textile/formatter.rb @@ -43,7 +43,7 @@ module Redmine # Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet. # http://code.whytheluckystiff.net/redcloth/changeset/128 def hard_break( text ) - text.gsub!( /(.)\n(?!\n|\Z|>| *([#*=]+(\s|$)|[{|]))/, "\\1
" ) if hard_breaks + text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
" ) if hard_breaks end # Patch to add code highlighting support to RedCloth diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index a221b6c8d..fa5f8adb4 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -113,7 +113,7 @@ RAW expected = <<-EXPECTED

John said:

-Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero. +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.
Nullam commodo metus accumsan nulla. Curabitur lobortis dui id dolor.