Allow defining options for PlantUML in Markdown
Hello,
this would be my first merge request here, and also my first try at contributing to Ruby code. Hopefully this is useful even if only as a suggestion! :)
What does this MR do?
This merge requests implements a way to define additional options for PlantUML diagrams like format
and width
in Markdown texts by defining them using the already known syntax from AsciiDoc as language for the code block.
Example usage:
```plantuml, format=svg, width=512px
A -> B
B -> C
C -> A
```
The old syntax with just ```plantuml
continues working as before.
The respective extra information that Markdown does not support defining the options has been removed from the documentation.
Are there points in the code the reviewer needs to double check?
I was not sure if there is a more integrated way to parse the options than manually splitting the language line and turning it into an options object. Plus that bit of code may not be fully optimized despite its shortness. For this reason I am also not sure if this fully adheres by the merge request performance guides.
Why was this MR needed?
The Markdown parser for texts written in the wiki or in the issue tracker didn't support the various options that PlantUML accepts for all the other document types. This will allow for SVG output instead of the default PNG output.
Screenshots (if relevant)
This is not a change to the graphical user interface part of GitLab.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together (through GitLab's own "Squash commits when merge request is accepted" option) -
Internationalization required/considered
What are the relevant issue numbers?
- #40991 (moved)
- #40978 (closed) (different syntax but tackles the same matter)