mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
192 stars 55 forks source link

Size of svg_inline diagrams #81

Closed anorm closed 1 year ago

anorm commented 1 year ago

I'm using plantuml-markdown from MkDocs with svg_inline to allow for clickable links. However, the diagrams ends up looking strange since there is no size information in the inline svg object.

On https://github.com/mikitex70/plantuml-markdown/blob/master/plantuml_markdown.py#L248, the width and height attributes of the generated SVG is removed when rendered as inline.

What is the rationale behind removing the width and height attributes?

Would you be open to adding an option to let the user configure this behavior? If so, I'll create a pull request.

mikitex70 commented 1 year ago

Hi @anorm, the code was written many years ago, I think the idea was to let the size of the diagram change according to the size of the container, allowing it to automatically resize the image. I also found that the current behavior is not optimal, let me check your PR and my work code to get the best out of them.

mikitex70 commented 1 year ago

Hi @anorm, your PR is now merged in the release 3.8.0. Thanks for your contribution.