blob: 36cc459ddd11e1e4d41ae6a6365f3428d65c1a75 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
function note(el)
el.classes = pandoc.List()
el.classes:insert("c-note")
return el
end
function figure(el)
local images = pandoc.List()
pandoc.walk_block(el, { Image = function(iel) images:insert(iel) end })
return pandoc.RawBlock("html",
"<figure class=\"c-figure\">\
<a class=\"c-figure__link\" href=\"" .. images[1].src .. "\">\
<img class=\"c-figure__image\" src=\"" .. images[1].src .. "\" title=\"" .. images[1].title .. "\" />\
</a>\
</figure>")
end
function Div(el)
if el.classes:includes("note") then
el = note(el)
elseif el.classes:includes("figure") then
el = figure(el)
end
return el
end
|