---json { "description": "How to create a code block with indentation", "page_id": "sn155ly18463a077jbfkq", "title": "Preformatted (indented code block) - ComboStrap" } --- ====== 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 [[code|block of code]] with no syntax highlighting. [[release:archive:1.11|since 1.11]] ===== Syntax ===== A line that starts with a couple of spaces is seen as a [[code|code of block]] with no syntax highlighting. If you want to add a language, you need to use the [[code|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|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 ==== No content ==== Without any content, the ''indented code block'' is not printed. You can disable this feature with the [[#preformattedEmptyContentNotPrintedEnable|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 [[docs:app:configuration|configuration]] ''preformattedEnable'' permits to enable or disable this feature. ==== preformattedEmptyContentNotPrintedEnable ==== If this [[docs:app:configuration|configuration]] is not check, a block of code will be printed even if there is no content.