rst renderer: error/warning/info/tip... admonition directives are not rendered the specified way

Summary

RestructuredText supports admonitions directives like "error" "warning" "info" etc.

rST says :

Admonitions ("safety messages" or "hazard statements") can appear anywhere an ordinary body element can. They contain arbitrary body elements. Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded.

See official spec at : https://docutils.sourceforge.io/docs/ref/rst/directives.html

Unfortunately, admonitions are not displayed in a distinguishable manner from normal text for reader.

Steps to reproduce

Create a rST document with normal text and an admonition in it. For example:

Some normal text paragraph.

Some other normal paragraph.

.. note:: This is a note admonition !

   And this is a paragraph in the admonition.

Another normal text paragraph.

Push the file to a Gitlab repository then display it the rendered way in Gitlab. You will almost see:

Some normal text paragraph.

Some other normal paragraph.

Note

This is a note admonition !

And this is a paragraph in the admonition.

Another normal text paragraph.

Tested on Gitlab 15.2.2 .

What is the current bug behavior?

Gitlab processes admonitions content as if it was not in an admonition directive but directly in the parent block. So there is no indentation. Note that the admonition type ('Note' in the example) is also displayed as a normal text paragraph.

What is the expected correct behavior?

Gitlab should display the admonition Type in a specific and distinguishable format. The content should be indented. Docutils reference implementation renders like this:

image

Note : admonitions may contain lists, code blocs or any other standard child blocs. All of them should appear indented and well formatted. That is working well right now.

More inputs

Gitlab's HTML page that render the rST file does include a specific unnamed <div> for the admonition. Although inside the Type isn't distinguished from the content. It seems that the CSS doesn't renders this div in a specific way.