Skip to content

Fix rendering plantUML over kroki in reStructuredText (rst) files

What does this MR do and why?

Fixes #354020 (closed)

Similar discussions: #267091 (closed), !60780 (merged), #324766 (closed) (maybe they want to participate in this MR)

Is a merge request of two contiguous (!95171 (merged))

This MR fixes rendering of plantUML in reStructuredText (rst) files if kroki is used in the GitLab instance.

Tip: If you want to try it out then add the following code: cache_key = nil after this line so that the image is always re-rendered when the page is reloaded

Screenshots or screen recordings

rendering of plantuml before fix: image

rendering of plantuml after fix: image

How to set up and validate locally

  1. Enable kroki.
  2. Use https://kroki.io for kroki URL
  3. Create a new .rst file with the following contents:
Software design
================

.. uml::

   == Initialization ==

   Alice -> Bob: Authentication Request
   Bob --> Alice: Authentication Response

   == Repetition ==

   Alice -> Bob: Another authentication Request
   Alice <-- Bob: another authentication Response


.. plantuml::
   :caption: Caption with **bold** and *italic*

   Bob -> Alice: hello
   Alice -> Bob: hi


.. code-block:: plantuml

  Bob->Alice : hello
  Alice -> Bob : hi

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Andreas Deicha

Merge request reports