aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2019-06-11 19:39:42 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2019-06-11 19:48:00 +0200
commit7f9b32e36a8fdfe3efdcdb05b84cafd297641d85 (patch)
tree94b4184959b31db3c1ff50c4cb1829610ea68ef0 /data
parent03b9f3d5f34633325141d48999a3222c6a34c796 (diff)
downloadpandoc-7f9b32e36a8fdfe3efdcdb05b84cafd297641d85.tar.gz
data/pandoc.lua: fix deletion of nonexistent attributes
Fixes: #5569
Diffstat (limited to 'data')
-rw-r--r--data/pandoc.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 8a45a39e9..859ecedc4 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -846,7 +846,10 @@ local AttributeList = {
__newindex = function (t, k, v)
local cur, idx = List.find_if(t, assoc_key_equals(k))
- if v == nil then
+ if v == nil and not cur then
+ -- deleted key does not exists in list
+ return
+ elseif v == nil then
table.remove(t, idx)
elseif cur then
cur[2] = v