Allow line breaks in wiki table cells (#2346).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2824 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-07-19 14:23:15 +00:00
parent 5ec4d4cdab
commit dcba9f18e6
3 changed files with 48 additions and 4 deletions
+7 -2
View File
@@ -784,6 +784,7 @@ class RedCloth3 < String
end
LINK_RE = /
(
([\s\[{(]|[#{PUNCT}])? # $pre
" # start
(#{C}) # $atts
@@ -797,13 +798,16 @@ class RedCloth3 < String
)
(\/)? # $slash
([^\w\=\/;\(\)]*?) # $post
)
(?=<|\s|$)
/x
#"
def inline_textile_link( text )
text.gsub!( LINK_RE ) do |m|
pre,atts,text,title,url,proto,slash,post = $~[1..8]
all,pre,atts,text,title,url,proto,slash,post = $~[1..9]
if text.include?('<br />')
all
else
url, url_title = check_refs( url )
title ||= url_title
@@ -821,6 +825,7 @@ class RedCloth3 < String
external = (url =~ /^https?:\/\//) ? ' class="external"' : ''
"#{ pre }<a#{ atts }#{ external }>#{ text }</a>#{ post }"
end
end
end
@@ -44,7 +44,7 @@ module Redmine
# Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet.
# <a href="http://code.whytheluckystiff.net/redcloth/changeset/128">http://code.whytheluckystiff.net/redcloth/changeset/128</a>
def hard_break( text )
text.gsub!( /(.)\n(?!\n|\Z|>| *(>? *[#*=]+(\s|$)|[{|]))/, "\\1<br />\n" ) if hard_breaks
text.gsub!( /(.)\n(?!\n|\Z|>| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks
end
# Patch to add code highlighting support to RedCloth