Literal Blocks
Use a literal block to display markup as text. The parser handles backslash escapes and nested literal blocks. It does not apply text styles, links, or macros inside the body.
Basic Literal Block
Use {{{ and }}} (without any element name) to create a literal block:
{{{
**This will not be processed as bold**
*This will not be italic*
[[This will not be a link]]
}}}The parser preserves interior text and line breaks. It trims trailing ASCII whitespace immediately before the closing delimiter.
Literal vs Code Blocks
Literal Block
Use a literal block to display markup without applying its styles:
{{{
This is literal text.
**Not bold** *Not italic*
A code fence such as ``` is shown as text.
}}}Code Block
Preserves content without processing SevenMark syntax, but marked as code:
```
This is code.
**Still not bold** but marked as code
```The HTML renderer uses a pre element for a literal block. A fenced code block marks the content as code and can carry a language for highlighting. See code syntax.
Common Use Cases
Showing SevenMark Syntax
Place the markup to display inside the literal delimiters:
To create bold text, use this syntax:
{{{
**Bold text here**
}}}
For links, use:
{{{
[[https://example.com | Link text]]
}}}Raw HTML or XML
{{{
<div class="container">
<h1>This HTML won't be parsed</h1>
<p>It will be displayed as text</p>
</div>
}}}Configuration Examples
{{{
# Configuration file
server.port = 8080
server.host = localhost
}}}Escaping Complex Markup
When you need to show complex nested structures:
{{{
{{{#table
[[[[Cell 1]] [[Cell 2]]]]
[[[[Cell 3]] [[Cell 4]]]]
}}}
}}}Literal Blocks in Documentation
Before and After Examples
Show the markup and its rendered result:
Markup:
{{{
{{{#list #type="numeric"
[[First item]]
[[Second item]]
}}}
}}}Result:
{{{#list #type="numeric"
[[First item]]
[[Second item]]
}}}Syntax Reference
Create a list with this syntax:
{{{
{{{#list #type="numeric"
[[Item 1]]
[[Item 2]]
}}}
}}}
The #type="numeric" parameter creates numbered items.Whitespace Preservation
Interior indentation and line breaks remain. Trailing ASCII whitespace before the closing }}} is trimmed:
{{{
Line 1
Indented Line 2
More indented Line 3
New paragraph after blank line
}}}Special Characters
Ordinary formatting markers remain text. Backslashes and delimiters still follow the escape and delimiter rules:
{{{
Characters that normally need escaping:
* asterisks *
_ underscores _
{ braces }
[ brackets ]
\\ backslashes \\
The renderer displays these formatting markers as text.
}}}Literal in Complex Structures
Literal in Lists
{{{#list #type="numeric"
[[Raw syntax: {{{**bold** *italic*}}}]]
[[Another example: {{{[[link]]}}}]]
}}}Literal in Tables
{{{#table
[[[[Syntax]] [[Description]]]]
[[[[{{{**text**}}}]] [[Bold text]]]]
[[[[{{{*text*}}}]] [[Italic text]]]]
}}}Literal in Folds
{{{#fold
[[Show Raw Markup]]
[[
{{{
``` #lang="rust"
fn main() {
println!("Hello!");
}
```
}}}
]]
}}}Delimiter Matching
Literal blocks use balanced triple-brace scanning. A nested {{{ increases the brace depth, and a }}} decreases it. The literal block closes only when that depth returns to zero:
{{{
Outer literal
{{{
Inner literal-looking text
}}}
Back in the outer literal
}}}A closing delimiter can be escaped when it should be literal text instead of ending the current depth:
{{{
This text contains \}}} as literal text.
}}}The scanner also respects balanced [[...]] and [...] regions while it is looking for the matching triple-brace close, so examples containing links, macros, and nested raw blocks can be shown without prematurely closing the outer literal block.
Comparison with Other Elements
| Element | Purpose | Syntax Processing |
|---|---|---|
Literal {{{}}} | Display markup as text | Escapes and nested literal blocks remain active |
| Code | Preserve text as code | Fenced code bodies are raw text |
Escape \ | Escape single characters | Selective - only escaped chars |
Comment /* ... */ | Hide text from rendered output | Retained as a comment node in the AST |
Use Cases Summary
Use Literal Blocks When:
- Showing SevenMark syntax examples
- Displaying raw markup for documentation
- Preventing interpretation of special characters in large blocks
- Creating "before and after" examples
- Showing configuration files or templates
Use Code Blocks Instead When:
- Working with programming code
- You want to mark content as code
- You want language-specific metadata (e.g.,
#lang="rust")
Use Escaping Instead When:
- You only need to escape a few characters
- You want the rest of the text to be formatted normally
- Working with inline content
Technical Notes
- Literal blocks use
{{{and}}}without any element identifier (no#after the braces) - Text styles, links, and macros are not evaluated inside literal blocks
- Backslash escapes and nested literal blocks are still parsed
- Interior whitespace is preserved; trailing ASCII whitespace before the close is trimmed
- Do not put parameters on a literal block
- Triple-brace delimiters are matched by depth; escaped delimiters stay in the literal text
- Literal blocks are distinct from comments (which hide content) and code blocks (which mark content as code)