---
title: Additional Pandoc features for Apex
date: 2026-01-01 15:00
slug: additional-pandoc-features-for-apex
categories:
- Blog
- Code
tags:
- markdown
- apex
- linking
- pandoc
- features
---

[Apex]: https://brettterpstra.com/projects/apex/

[Apex] has always supported Kramdown-style IAL (Inline Attribute Lists), but I've been steadily adding more Pandoc compatibility. The latest release brings several new features that make Apex work better with Pandoc-style markdown while maintaining backward compatibility.

Thanks to [somelinguist](https://github.com/somelinguist) for the [suggestions](https://github.com/ApexMarkdown/apex/issues/3)!

### Table Captions Get More Flexible

Table captions now support three different formats. You can use the existing `[Caption]` and `Table: Caption` syntax, plus the new Pandoc-style `: Caption` format:

```markdown
| Col1 | Col2 |
|------|------|
| A    | B    |

: This is a Pandoc-style caption
```

Even better, IAL attributes in table captions are now extracted and applied to the table element itself. So you can do things like:

```markdown
| Col1 | Col2 |
|------|------|
| A    | B    |

: My Table {#table-id .highlight}
```

This applies both the `id="table-id"` and `class="highlight"` attributes directly to the `<table>` element, not just the caption.

### Pandoc-Style IAL Everywhere

One of the biggest changes is full support for Pandoc-style IAL syntax without the colon prefix. Where you used to need `{: #id .class}`, you can now use `{#id .class}` in all contexts:

- Block-level IALs after headings, paragraphs, and other blocks
- Inline IALs on links, images, emphasis, and other inline elements
- Pure IAL paragraphs
- Table captions

Both formats work, so your existing Kramdown documents continue to work while new Pandoc-style documents are fully supported.

### Fenced Divs

Pandoc's fenced divs are now supported in unified mode (enabled by default). You can create custom block containers with attributes:

```markdown
::::: {#warning .alert}
This is a warning box with custom styling.
:::::
```

Fenced divs support nesting, attributes, and all the usual IAL features. You can control them with the `--divs` and `--no-divs` command-line flags.

### Bracketed Spans

Bracketed spans let you create inline HTML spans with attributes using a simple syntax:

```markdown
This is [some text]{.highlight} with a span.
```

The `[text]{IAL}` syntax converts to `<span class="highlight">some text</span>`. It supports all IAL attribute types—IDs, classes, and key-value pairs—and processes markdown inside the spans.

Reference links take precedence, so if `[text]` matches a reference link definition, it stays a link. Otherwise, it becomes a span. Bracketed spans are enabled by default in unified mode, and you can control them with `--spans` and `--no-spans` flags.

### Image Attributes Get Smarter

Image support has been significantly enhanced. You can now use IAL syntax on both inline and reference-style images:

```markdown
![alt text](image.jpg){#my-image .photo width=50%}

[ref]: image.jpg "Title" {#ref-image .thumbnail width=300px}
![alt][ref]
```

The width and height conversion follows Pandoc's rules:
- Percentages like `width=50%` convert to `style="width: 50%"`
- Pixel values like `width=300px` convert to `width="300"` (the `px` suffix is stripped)
- Bare integers like `width=300` stay as `width="300"`
- Other units like `5em` or `10rem` convert to style attributes
- Decimal pixel values like `100.5px` also go to style attributes

This means you get clean, semantic HTML output that works well across different contexts. Reference image definitions also now preserve title attributes, so `[ref]: url "title" {#id}` includes the title in the final output.

### Better IAL Detection

I've improved IAL detection throughout the codebase. IAL syntax with spaces (like `{ width=50% }`) now works correctly, and IALs are properly stripped from output even when parsing fails, preventing raw IAL syntax from appearing in your HTML.

All of these features work together seamlessly. You can mix Kramdown and Pandoc syntax in the same document, use IALs everywhere, and get clean, semantic HTML output. The test suite has been expanded to cover all these new features, so everything should work reliably.

Check out the [latest release](https://github.com/ApexMarkdown/apex/releases/latest) for full release notes. And if you haven't tried Apex yet, check out [the Apex project][Apex] and help me build the ultimate Markdown processor!

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
