summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-04 17:12:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-04 17:12:59 +0000
commit735db3dae5c16d13bf7ae3af992bb9b23644a4fa (patch)
tree76d772535a48f9a7b39fcdd4c1fec2b6250116ac /lib
parenta77fb3b59109a296605fa435db349c3b1eb442eb (diff)
downloadredmine-735db3dae5c16d13bf7ae3af992bb9b23644a4fa.tar.gz
redmine-735db3dae5c16d13bf7ae3af992bb9b23644a4fa.zip
Allow empty cells in wiki tables.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1490 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redcloth.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/redcloth.rb b/lib/redcloth.rb
index 344fd6c78..3880eb9d3 100644
--- a/lib/redcloth.rb
+++ b/lib/redcloth.rb
@@ -504,26 +504,19 @@ class RedCloth < String
tatts = shelve( tatts ) if tatts
rows = []
- fullrow.
- split( /\|$/m ).
- delete_if { |x| x.empty? }.
- each do |row|
-
+ fullrow.each_line do |row|
ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
-
cells = []
- #row.split( /\(?!\[\[[^\]])|(?![^\[]\]\])/ ).each do |cell|
- row.split( /\|(?![^\[\|]*\]\])/ ).each do |cell|
+ row.split( /(\|)(?![^\[\|]*\]\])/ )[1..-2].each do |cell|
+ next if cell == '|'
ctyp = 'd'
ctyp = 'h' if cell =~ /^_/
catts = ''
catts, cell = pba( $1, 'td' ), $2 if cell =~ /^(_?#{S}#{A}#{C}\. ?)(.*)/
- unless cell.strip.empty?
- catts = shelve( catts ) if catts
- cells << "\t\t\t<t#{ ctyp }#{ catts }>#{ cell }</t#{ ctyp }>"
- end
+ catts = shelve( catts ) if catts
+ cells << "\t\t\t<t#{ ctyp }#{ catts }>#{ cell }</t#{ ctyp }>"
end
ratts = shelve( ratts ) if ratts
rows << "\t\t<tr#{ ratts }>\n#{ cells.join( "\n" ) }\n\t\t</tr>"