mirror of
https://github.com/SharpeTronics/jekyll-spaceship.git
synced 2025-12-17 00:03:13 -05:00
fix: html inside table cell not working
This commit is contained in:
parent
c916d10c6b
commit
a85ec310cd
@ -161,7 +161,7 @@ module Jekyll::Spaceship
|
|||||||
if scope.table.multi_row_cells != cells and scope.table.multi_row_start
|
if scope.table.multi_row_cells != cells and scope.table.multi_row_start
|
||||||
for i in 0...scope.table.multi_row_cells.count do
|
for i in 0...scope.table.multi_row_cells.count do
|
||||||
multi_row_cell = scope.table.multi_row_cells[i]
|
multi_row_cell = scope.table.multi_row_cells[i]
|
||||||
multi_row_cell.inner_html += "<br>#{cells[i].inner_html}"
|
multi_row_cell.inner_html += "\n<br>\n#{cells[i].inner_html}"
|
||||||
end
|
end
|
||||||
row.remove
|
row.remove
|
||||||
end
|
end
|
||||||
@ -186,7 +186,7 @@ module Jekyll::Spaceship
|
|||||||
span_cell = scope.table.span_row_cells[scope.row.col_index]
|
span_cell = scope.table.span_row_cells[scope.row.col_index]
|
||||||
if span_cell and cell.content.match(/^\s*\^{2}/)
|
if span_cell and cell.content.match(/^\s*\^{2}/)
|
||||||
cell.content = cell.content.gsub(/^\s*\^{2}/, '')
|
cell.content = cell.content.gsub(/^\s*\^{2}/, '')
|
||||||
span_cell.inner_html += "<br>#{cell.inner_html}"
|
span_cell.inner_html += "\n<br>\n#{cell.inner_html}"
|
||||||
rowspan = span_cell.get_attribute('rowspan') || 1
|
rowspan = span_cell.get_attribute('rowspan') || 1
|
||||||
rowspan = rowspan.to_i + 1
|
rowspan = rowspan.to_i + 1
|
||||||
span_cell.set_attribute('rowspan', "#{rowspan}")
|
span_cell.set_attribute('rowspan', "#{rowspan}")
|
||||||
@ -242,6 +242,8 @@ module Jekyll::Spaceship
|
|||||||
content = cell.inner_html
|
content = cell.inner_html
|
||||||
.gsub(/(?<!\\)\|/, '\\|')
|
.gsub(/(?<!\\)\|/, '\\|')
|
||||||
.gsub(/^\s+|\s+$/, '')
|
.gsub(/^\s+|\s+$/, '')
|
||||||
|
.gsub(/</, '<')
|
||||||
|
.gsub(/>/, '>')
|
||||||
content = cvter.convert(content)
|
content = cvter.convert(content)
|
||||||
content = Nokogiri::HTML.fragment(content)
|
content = Nokogiri::HTML.fragment(content)
|
||||||
if content.children.first&.name == 'p'
|
if content.children.first&.name == 'p'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user