Skip to content

custom writer CaptionedImage() not recieving attribute parameter #2697

Closed
crmackay opened this Issue · 0 comments

1 participant

@crmackay

I'm trying to implement a custom writer that outputs captioned figures with attributes, however, it appears that the CaptionedImage() function call does not include the attribute table attr as one of its parameters. The Image() function on the other hand does receive the attr parameter.

taken from the the sample.lua file:

function CaptionedImage(src, tit, caption)
   return '<div class="figure">\n<img src="' .. escape(src,true) ..
      '" title="' .. escape(tit,true) .. '"/>\n' ..
      '<p class="caption">' .. caption .. '</p>\n</div>'
end

[...]

function Image(s, src, tit, attr)
  return "<img src='" .. escape(src,true) .. "' title='" ..
         escape(tit,true) .. "'/>"
end

I would hazard a guess that this has something to do with lines 225-256 of pandoc/Writers/Custom.hs

blockToCustom lua (Para [Image _ txt (src,tit)]) =
  callfunc lua "CaptionedImage" src tit txt

but I'm not sure how to put an attr parameter in there

@jgm jgm closed this in a692bd2
@c-forster c-forster pushed a commit to c-forster/pandoc that referenced this issue
@jgm Custom writer: Pass attributes parameter to CaptionedImage.
Closes #2697.
c28acdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.