pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
600 stars 165 forks source link

diagram-generator doesn't recognize width and height on code block #242

Closed fuhrmanator closed 2 years ago

fuhrmanator commented 2 years ago

If I want to resize a diagram, e.g.,

```{.plantuml width=50%}

the width is ignored.

I think it's an easy fix by just passing in the width and height when creating the img_attr in the filter:

  local img_attr = {
    id = block.identifier,
    name = block.attributes.name,
    width = block.attributes.width,
    height = block.attributes.height
  }

My tests locally show it works. I can do a PR if this is acceptable.

tarleb commented 2 years ago

Looks good, I can't think of any reason against this. A PR would be very welcome.