Table of Contents

About

Preformatted is a syntax that considers any successive lines that starts with two spaces as a block of code.

This is also known as indented code block and is a minimal syntax to create a block of code with no syntax highlighting.

since 1.11

Syntax

A line that starts with a couple of spaces is seen as a code of block with no syntax highlighting. If you want to add a language, you need to use the code component

  Two spaces starts a block of code

Without any content, the indented code block is not printed. You can disable this feature with the preformattedEmptyContentNotPrintedEnable configuration

Demo

Default

  • Input: A line that starts with two space
  A line that starts with a couple of spaces is seen as a code of block
  The next one with two spaces will also be part of the same block
  • Output: A block of code without any syntax highlighting
A line that starts with a couple of spaces is seen as a code of block
The next one with two spaces will also be part of the same block

No content

Without any content, the indented code block is not printed.

You can disable this feature with the preformattedEmptyContentNotPrintedEnable configuration

  • There is two spaces below (You don't see them)
  
  • And there is no code block created as output. (ie below)

Configuration

preformattedEnable

The configuration preformattedEnable permits to enable or disable this feature.

preformattedEmptyContentNotPrintedEnable

If this configuration is not check, a block of code will be printed even if there is no content.