summaryrefslogtreecommitdiff
path: root/data/sample.lua
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-27 10:48:28 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-27 10:48:34 -0800
commitcb4123841c5224c8862322d866ebb69153420b3e (patch)
treec2c2c8d7fab283dbb3abccf4564a2823fc1546e7 /data/sample.lua
parent1ce426a9cb9552a3388eb3d1b5e594ceb1d1f431 (diff)
Revert "data/sample.lua: Fixed problem with definition lists."
This reverts commit 0e3736422ee97a5cfedc255705f566a319f954f9 in favor of @tarleb's fix.
Diffstat (limited to 'data/sample.lua')
-rw-r--r--data/sample.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/data/sample.lua b/data/sample.lua
index 3ea95ebd8..0c9422743 100644
--- a/data/sample.lua
+++ b/data/sample.lua
@@ -245,9 +245,11 @@ end
-- Revisit association list STackValue instance.
function DefinitionList(items)
local buffer = {}
- for _,item in ipairs(items) do
- table.insert(buffer,"<dt>" .. item[1] .. "</dt>\n<dd>" ..
- table.concat(item[2],"</dd>\n<dd>") .. "</dd>")
+ for _,item in pairs(items) do
+ for k, v in pairs(item) do
+ table.insert(buffer,"<dt>" .. k .. "</dt>\n<dd>" ..
+ table.concat(v,"</dd>\n<dd>") .. "</dd>")
+ end
end
return "<dl>\n" .. table.concat(buffer, "\n") .. "\n</dl>"
end