Skip to content

RestructuredText renderer breaks for some forms of input

When attempting to include a piece of raw ASCII text inside a RST file, the renderer breaks, and instead of rendering it as plain ASCII inside a nicely formatted Restructuredtext document, the text is not rendered correctly at all.

Here is what it looks like in the editor good-rst

Here is how it is rendered bad-rst

This is a piece that enables you to replicate the behaviour.

::

         ┌──────┐              ┌───────┐          ┌──────────┐          ┌────────┐          ┌──────┐     
         │HP_NFC│              │browser│          │NFC_reader│          │from_nfc│          │to_nfc│     
         └──┬───┘              └───┬───┘          └────┬─────┘          └───┬────┘          └──┬───┘     
            │                      │                   │                    │                  │         
            │                      │         ╔═════════╧══════╗             │                  │         
    ════════╪══════════════════════╪═════════╣ Initialization ╠═════════════╪══════════════════╪═════════
            │                      │         ╚═════════╤══════╝             │                  │         
            │                      │                   │                    │                  │         
       ╔════╧══════╗               │                   │                    │                  │         
       ║subscribe ░║               │                   │                    │                  │         
       ║ to_nfc    ║               │                   │                    │                  │         
       ╚════╤══════╝               │                   │                    │                  │         
            │                 ╔════╧══════╗            │                    │                  │         
            │                 ║subscribe ░║            │                    │                  │         
            │                 ║ from_nfc  ║            │                    │                  │         
            │                 ╚════╤══════╝            │                    │                  │         
            │                      │                   │                    │                  │        

This happens on Gitlab 8.12.1, but I have the feeling that it was alright in the past, because I was using this diagram many times in the past and noticed that it is broken now. The only thing that has changed is Gitlab itself, it is updated a few times per month, but I don't know what version it worked well in.

If you're wondering, these types of diagrams are generated with PlantUML.