Skip to content

AsciiDoc: Add support for built-in alignment roles

severity4 frontend asciidoc

Summary

Asciidoctor's Built-in alignment roles will not be rendered.

Description

Gitlab uses the Asciidoctor Ruby gem to convert AsciiDoc to HTML5.1 While Gitlab encourages to consult the Asciidoctor User Manual for a complete reference, this directive is not displayed, and therefore not available in Gitlab. This is due to Gitlab's aggressive sanitization filters, which prevent this feature to be used as stated in the aforementioned user manual.

Steps to reproduce

Create a document.adoc file, then write:

[.text-center]
This text is centered.

Finally, preview it on Gitlab.

What is the current bug behavior?

The text is not centered.

What is the expected correct behavior?

The text should be centered.

Possible fixes

For anyone trying to fix this, the classes text-center, text-left, text-center, text-right, and text-justify need to be allowed in the Gitlab's AsciiDoc Sanitization Filter, and then add the relevant style in the typography stylesheet.


  1. https://docs.gitlab.com/ee/user/asciidoc.html

Edited by Minerva Orlova