Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit 87352c3

Browse files
committed
fixed colspan bug
1 parent b4834e5 commit 87352c3

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

jWebUnit/fitplugin/rubywiki/wiki.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,15 @@ def emitCode(codeArr, code, depth)
101101
end
102102

103103
def asRow(s)
104-
puts "<!-- asRow => #{s} -->"
105-
cells = s.split('|')[1..-1]
106-
puts "<!-- cells => #{cells.inspect} -->"
104+
cells = s.sub!(/^\|/, '').scan(/([^|]*)\|/).flatten
107105
cellspans = []
108106
cells.each do |e|
109-
if e.strip! != ''
110-
cellspans << [e, 1]
107+
if e.strip != ''
108+
cellspans.push [e, 1]
111109
else
112110
cellspans.last[1] += 1 unless cellspans.empty?
113111
end
114112
end
115-
puts "<!-- cellspans => #{cellspans.inspect} -->"
116113
row = '<tr>'
117114
cellspans.each do |cell|
118115
content = cell[0]

0 commit comments

Comments
 (0)