Markdown Block

Which Markdown specification is used in Pushword — CommonMark, GFM, or something else?

The default Markdown implementation in Pushword is based on CommonMark, with a few customizations designed to make it easy to switch between Markdown and a WYSIWYG block editor.

For users

The difference is almost invisible — your usual Markdown syntax will continue to work as expected.

For developers

Markdown content is parsed block by block, rather than as a single document. Blocks are separated by two blank lines.

Attributes can be defined using the syntax {#attribute-name}, placed on a separate line just before the Markdown block it applies to. This is conflicting with Prettier Markdown.

Advanced content types such as galleries, attachments, or page lists are supported through Twig functions.

You can use twig syntax inside markdown inline code or markdown code block, it will not be parsed by twig. If you want to use twig inside inline code or code block, use html directly (<pre></pre>).

Tables

Standard GFM table syntax is supported. You can merge cells horizontally using -> as the cell content — it merges into the preceding cell via colspan.

| Service         | Identifiant | ->             |
| --------------- | ----------- | -------------- |
| Authentication  | auth        | oauth.provider |

Renders as a table where "Identifiant" spans two columns. Multiple -> cells can follow each other to span more columns.

Note: -> in the first cell of a row has no effect (no preceding cell to merge into).

Column alignment

Per-column alignment uses the GFM delimiter row: :--- (left), :--: (center), ---: (right). The block editor's column menu writes these markers for you.

| Name  | Price | Qty  |
| :---- | ----: | :--: |
| Apple | 1.20  | 3    |

Add the {.table-sticky-header} block attribute on the line before a table to pin its heading row while scrolling (in the editor and on the front). The block editor's "Sticky heading" toggle adds it for you.

{.table-sticky-header}

| Col 1 | Col 2 |
| ----- | ----- |
| Val   | Val 2 |

Example

{#example-content}

## Example Content

{#mainParagraph}
This is a paragraph.

{#mainGallery}
{{ gallery(['piedweb-logo.png', '1.jpg', '2.jpg', '3.jpg']) }}