Preformatted (indented code block) - ComboStrap

Undraw My Documents

ComboStrap UI - Preformatted (Indented code block)

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.




Showcase yourself and your brand

Get free news, tips, and tricks
to create a remarkable experience for your readers.




Recommended Pages
Undraw My Documents
ComboStrap - Prism

Prism components permits to add raw external content in the web page with extra's such as line number, copy to clipboard and eventually code highlighting The following component are prism component:...
Undraw My Documents
ComboStrap UI - Code

The code component permits to format block of code and add features such as: syntax highlighting clipboard copy line numbering You can create block of code like this one: HTMLwebcode HTML...
Undraw My Documents
Markdown syntax supported in ComboStrap

This page lists all markdown syntax supported in ComboStrap



Task Runner