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!
-
Enable PlantUML
- Go to the general application settings, http://ee.gitlab.test:5100/admin/application_settings/general#js-plantuml-settings
- Click "Enable PlantUML" and set the URL to
http://www.plantuml.com/plantuml
-
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 -
We aggressively cache in redis, so change
if cache_key
toif false
in https://gitlab.com/gitlab-org/gitlab/blob/master/lib/banzai/renderer.rb#L23-L23 -
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
-
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #424407 (closed)