manfilter.lua: remove extra indent in table cells with code blocks.
This commit is contained in:
parent
07e79f68a7
commit
989f315a84
1 changed files with 24 additions and 0 deletions
|
@ -11,6 +11,30 @@ function Header(el)
|
|||
end
|
||||
end
|
||||
|
||||
-- unindent table content
|
||||
function Table(el)
|
||||
for _,body in ipairs(el.bodies) do
|
||||
handleTableBody(body)
|
||||
end
|
||||
return el
|
||||
end
|
||||
|
||||
local function handleCell(el)
|
||||
if #el.contents > 0 and el.contents[1].t == "CodeBlock" then
|
||||
table.insert(el.contents, 1, pandoc.RawBlock("man", ".RS -14n"))
|
||||
table.insert(el.contents, pandoc.RawBlock("man", ".RE"))
|
||||
end
|
||||
end
|
||||
|
||||
function handleTableBody(el)
|
||||
for _,row in ipairs(el.body) do
|
||||
for _,cell in ipairs(row.cells) do
|
||||
handleCell(cell)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- replace links with link text
|
||||
function Link(el)
|
||||
return el.content
|
||||
|
|
Loading…
Reference in a new issue