Skip to content

PlantUML not rendering for reStructured files

What does this MR do and why?

Fix parsing of the language attribute on code blocks in reStructuredText rendering. This will allow PlantUML graphs to be displayed again.

How to set up and validate locally

Buckle up!

  1. Enable PlantUML

  2. The server uses a more updated protocol, so we need to add conf.encoding = 'deflate' into the file https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/plantuml.rb#L14-L14

  3. We aggressively cache in redis, so change if cache_key to if false in https://gitlab.com/gitlab-org/gitlab/blob/master/lib/banzai/renderer.rb#L23-L23

  4. Go to a project repo and create a file called test.rst with the following contents

    .. plantuml::
           :caption: Caption with **bold** and *italic*
    
           Bob -> Alice: hello
           Alice -> Bob: hi
  5. view the file, and you should see the graph generated

MR acceptance checklist

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

Related to #424407 (closed)

Edited by Brett Walker

Merge request reports