Markdown Reference

This is the complete Markdown reference for Ava CMS. Ava uses CommonMark as the base parser with GitHub Flavored Markdown (GFM) extensions enabled by default.

What's what? Features marked GFM come from the GitHub Flavored Markdown extension. Features marked Ava are specific to Ava CMS.

Paragraphs

Paragraphs are separated by one or more blank lines. A single line break within text does not create a new paragraph—it's treated as a space.

Markdown
This is the first paragraph. This is the second paragraph.
Result

This is the first paragraph.

This is the second paragraph.

Line Breaks

To create a line break (<br>) without starting a new paragraph, end a line with two or more spaces, or use a backslash (\).

Markdown (two trailing spaces)
Roses are red·· Violets are blue

The ·· represents two spaces.

Result
Roses are red
Violets are blue
Markdown (backslash)
Roses are red\ Violets are blue
Result
Roses are red
Violets are blue

Headings

Create headings using # symbols (ATX style) or underlines (Setext style). There are six levels of headings.

ATX Style (Recommended)

Markdown
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6
Result

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Setext Style (H1 and H2 only)

Markdown
Heading 1 ========= Heading 2 ---------
Result

Heading 1

Heading 2

Emphasis (Bold & Italic)

Use asterisks (*) or underscores (_) for emphasis. One for italic, two for bold, three for both.

StyleMarkdownResult
Italic*italic* or _italic_italic
Bold**bold** or __bold__bold
Bold + Italic***both*** or ___both___both
Mixed**bold and _nested italic_**bold and nested italic

Strikethrough GFM

Wrap text in double tildes to strike it through.

Markdown
~~This text is crossed out~~
Result
This text is crossed out

Lists

Unordered Lists

Use -, *, or + followed by a space.

Markdown
- First item - Second item - Third item
Result
  • First item
  • Second item
  • Third item

Ordered Lists

Use numbers followed by a period. The actual numbers don't matter—Markdown will number them sequentially.

Markdown
1. First item 2. Second item 3. Third item
Result
  1. First item
  2. Second item
  3. Third item

Nested Lists

Indent items with 2–4 spaces to create nested lists.

Markdown
- Parent item - Child item - Child item - Grandchild - Another parent
Result
  • Parent item
    • Child item
    • Child item
      • Grandchild
  • Another parent

Mixed Lists

You can mix ordered and unordered lists by nesting.

Markdown
1. First step - Sub-point A - Sub-point B 2. Second step
Result
  1. First step
    • Sub-point A
    • Sub-point B
  2. Second step

Task Lists GFM

Create checkboxes with [ ] (unchecked) or [x] (checked).

Markdown
- [x] Write documentation - [x] Test examples - [ ] Publish
Result
  • Write documentation
  • Test examples
  • Publish

Images

Same syntax as links, but with a leading !. The text in brackets becomes the alt text.

Basic Image

Markdown
![A cute cat](/media/cat.jpg)
HTML Output
<img src="/media/cat.jpg" alt="A cute cat">

Image with Title

Markdown
![Cat](/media/cat.jpg "My cat Whiskers")
HTML Output
<img src="/media/cat.jpg" alt="Cat" title="My cat Whiskers">

Linked Image

Wrap an image in link syntax to make it clickable.

Markdown
[![Alt text](/media/thumb.jpg)](/media/full.jpg)
HTML Output
<a href="/media/full.jpg"> <img src="/media/thumb.jpg" alt="Alt text"> </a>

Code

Inline Code

Wrap text in single backticks for inline code.

Markdown
Use the `echo` command.
Result
Use the echo command.

Inline Code with Backticks

To include a literal backtick, use double backticks.

Markdown
``Use `backticks` in code``
Result
Use `backticks` in code

Fenced Code Blocks

Use triple backticks or tildes. Add a language identifier for syntax highlighting.

Markdown
```php <?php echo "Hello, World!"; ```
Result
<?php
echo "Hello, World!";

Indented Code Blocks

Indent lines by 4 spaces or 1 tab. No syntax highlighting available.

Markdown
function hello() { return "Hi!"; }
Result
function hello() {
    return "Hi!";
}

Common Language Identifiers

LanguageIdentifier
PHPphp
JavaScriptjs or javascript
HTMLhtml
CSScss
JSONjson
YAMLyaml or yml
Bash / Shellbash or sh
Plain texttext or plaintext

Blockquotes

Prefix lines with > to create a blockquote.

Basic Blockquote

Markdown
> This is a blockquote. > It can span multiple lines.
Result
This is a blockquote. It can span multiple lines.

Nested Blockquotes

Markdown
> Outer quote >> Nested quote >>> Deeply nested
Result
Outer quote
Nested quote
Deeply nested

Blockquotes with Other Elements

Markdown
> ### Heading in a quote > > - List item one > - List item two > > **Bold** works too.
Result

Heading in a quote

  • List item one
  • List item two

Bold works too.

Horizontal Rules

Create a horizontal line with three or more hyphens, asterisks, or underscores on their own line.

MarkdownResult
---
***
___

You can also use spaces between: - - - or * * *

Tables GFM

Create tables using pipes (|) and hyphens (-).

Basic Table

Markdown
| Name | Role | |---------|-----------| | Ada | Developer | | Grace | Manager |
Result
NameRole
AdaDeveloper
GraceManager

Column Alignment

Use colons in the separator row to control alignment.

SyntaxAlignment
:---Left (default)
:---:Center
---:Right
Markdown
| Item | Qty | Price | |:-------|:---:|-------:| | Apples | 5 | $1.20 | | Bread | 2 | $3.50 |
Result
ItemQtyPrice
Apples5$1.20
Bread2$3.50

Escaping Characters

Prefix special characters with a backslash (\) to display them literally.

Characters You Can Escape

CharacterNameEscaped
\Backslash\\
`Backtick\`
*Asterisk\*
_Underscore\_
{}Curly braces\{ \}
[]Square brackets\[ \]
()Parentheses\( \)
#Hash\#
+Plus\+
-Hyphen\-
.Period\.
!Exclamation\!
|Pipe\|
Markdown
\*This is not italic\* 1\. Not a list item
Result

*This is not italic*

1. Not a list item

Raw HTML

By default, Ava allows raw HTML in your Markdown. This is controlled by the content.markdown.allow_html setting.

Markdown
This has <mark>highlighted</mark> text. <details> <summary>Click to expand</summary> Hidden content here. </details>
Result

This has highlighted text.

Click to expand Hidden content here.

HTML Entities

Standard HTML entities work as expected.

EntityResultDescription
&amp;&Ampersand
&lt;<Less than
&gt;>Greater than
&copy;©Copyright
&mdash;Em dash
&nbsp;(non-breaking space)Non-breaking space

Disallowed Tags

You can block specific HTML tags for security using content.markdown.disallowed_tags in your config, even when HTML is allowed.

Ava-Specific Features Ava

Automatic Heading IDs

Ava automatically adds id attributes to headings for anchor links. This is enabled by default via content.markdown.heading_ids.

Markdown
## Getting Started
HTML Output
<h2 id="getting-started">Getting Started</h2>

This lets you link directly to sections: /docs/page#getting-started

Path Aliases

Use configured aliases (like /media/) in image and link paths. Ava expands them during rendering.

Markdown
![Photo](/media/vacation.jpg)
HTML Output
<img src="/media/vacation.jpg" alt="Photo">

Configure aliases in app/config/ava.php under paths.aliases.

Shortcodes

Ava processes shortcodes in your content after Markdown rendering. See the Shortcodes documentation for details.

Markdown
[youtube id="dQw4w9WgXcQ"]
Result
(Rendered shortcode output)

Features Not Supported by Default

These features are not enabled in Ava's default Markdown configuration. They can be added via plugins using the markdown.configure hook.

  • Footnotes ([^1])
  • Definition lists
  • Abbreviations
  • Table row/column spans
  • Math/LaTeX ($x^2$)
  • Smart typography (curly quotes, em-dashes)
  • Wiki-style links ([[Page]])
  • Mermaid diagrams
  • Table of contents generation

See Creating Plugins to learn how to extend the Markdown parser.