git.iko.soy/typeable/pandoc
on master help sign in
pandoc.lua: destructure attr for Link and Image

Make Attr values accessible through through the keys `identifier`, `classes` and `attributes`. This is already used in other elements with attributes and is now fixed for Link and Image.

commitcab4f982f3093da9173e452cf25dba455dca03cf authorAlbert Krewinkel <albert@zeitkraut.de> dateTue 17 Oct 2017, 21:45 (9 years ago) parent8aa972d
1 file changed+2−2
data/pandoc.lua+2−2
data/pandoc.lua+2−2
@@ -424,7 +424,7 @@ M.Image = M.Inline:create_constructor(
424424 attr = attr or M.Attr()
425425 return {c = {attr, caption, {src, title}}}
426426 end,
427− {"attributes", "caption", {"src", "title"}}
427+ {{"identifier", "classes", "attributes"}, "caption", {"src", "title"}}
428428)
429429
430430--- Create a LineBreak inline element
@@ -449,7 +449,7 @@ M.Link = M.Inline:create_constructor(
449449 attr = attr or M.Attr()
450450 return {c = {attr, content, {target, title}}}
451451 end,
452− {"attributes", "content", {"target", "title"}}
452+ {{"identifier", "classes", "attributes"}, "content", {"target", "title"}}
453453)
454454
455455--- Creates a Math element, either inline or displayed.