Skip to content

Commit 36e5a67

Browse files
author
Corey White
committed
updated DefList
1 parent ac5c3d8 commit 36e5a67

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

utils/pandoc_codeblock.lua

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,38 +101,40 @@ end
101101
-- return pandoc.Para({pandoc.RawInline("markdown", "![" .. alt_text .. "](" .. src .. ")")})
102102
-- end
103103

104-
function DefinitionList(el)
105-
local new_blocks = {}
106-
107-
for _, item in ipairs(el.content) do
108-
local term = item[1] -- Term (<dt>)
109-
local definitions = item[2] -- Definitions (<dd>)
110-
111-
-- Split the term into separate parts: first word as header, rest as sub-item
112-
if #term > 1 then
113-
-- First part of the term becomes the header (###)
114-
-- term[1] = term[1].src
115-
table.insert(new_blocks, pandoc.Header(3, term[1], {}))
116-
117-
-- Remaining parts are combined and formatted (e.g., italicized)
118-
local sub_term = {}
119-
for i = 2, #term do
120-
table.insert(sub_term, term[i])
121-
end
122-
table.insert(new_blocks, pandoc.Para(sub_term))
123-
else
124-
-- If the term is simple, just use it as a header
125-
table.insert(new_blocks, pandoc.Header(3, term, {}))
126-
end
104+
-- function DefinitionList(el)
105+
-- local new_blocks = {}
127106

128-
-- Process the definitions and convert to blockquote format
129-
for _, def in ipairs(definitions) do
130-
table.insert(new_blocks, pandoc.BlockQuote(def))
131-
end
132-
end
107+
-- for _, item in ipairs(el.content) do
108+
-- local term = item[1] -- Term (<dt>)
109+
-- local definitions = item[2] -- Definitions (<dd>)
110+
111+
-- -- Split the term into separate parts: first word as header, rest as sub-item
112+
-- if #term > 1 then
113+
-- -- First part of the term becomes the header (###)
114+
-- -- term[1] = term[1].src
115+
-- table.insert(new_blocks, pandoc.Header(3, term[1], {}))
116+
117+
-- -- Remaining parts are combined and formatted (e.g., italicized)
118+
-- local sub_term = {}
119+
-- for i = 2, #term do
120+
-- table.insert(sub_term, term[i])
121+
-- end
122+
-- table.insert(new_blocks, pandoc.Para(sub_term))
123+
-- else
124+
-- -- If the term is simple, just use it as a header
125+
-- table.insert(new_blocks, pandoc.Header(3, term, {}))
126+
-- end
127+
128+
-- -- table.insert(new_blocks, pandoc.HorizontalRule(definitions))
129+
130+
-- -- Process the definitions and convert to blockquote format
131+
-- for _, def in ipairs(definitions) do
132+
-- table.insert(new_blocks, pandoc.HorizontalRule(def))
133+
-- end
134+
-- end
133135

134-
return new_blocks
135-
end
136+
-- return new_blocks
137+
-- end
136138

137139
function TableCell(el)
138140
-- Remove inline styles from table cells

0 commit comments

Comments
 (0)