374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
|
# File 'lib/slaw/za/act_nodes.rb', line 374
def to_xml(b, idprefix)
html = WikiCloth::Parser.new({data: self.text_value}).to_html
html = Nokogiri::HTML(html)
table = html.css("table").first
table['id'] = "#{idprefix}table0"
table.css("td, th").each do |cell|
p = Nokogiri::XML::Node.new("p", html)
p.children = cell.children
p.parent = cell
end
table.xpath('//text()[1]').each{ |t| t.content = t.content.lstrip }
table.xpath('//text()[last()]').each{ |t| t.content = t.content.rstrip }
b << table.to_html
end
|