Support for Extension Token

In fact, there are a few different kinds of extensions you need
to make room for:

  1. operate on raw text and yield a block element
  2. operate on raw text and yield an inline element
  3. operate on commonmark block content and yield a block element
  4. operate on commonmark inline content and yield an inline element

In pandoc, we’ve developed a system that works well for all four.

  1. fenced code block with structured attributes or a “raw”
    annotation

    ``` {=dot}
    graph graphname {
    a -- b -- c;
    b -- d;
    }
    ```
    
  2. inline code backticks with structured attributes or a “raw”
    annotation

    $x^2${=latex}

  3. fenced div with structured attributes

    ::: warning
    1. Don't read this.
    2. Or you'll regret it.
    :::
    
  4. bracketed inlines (as in links) with structured attributes

    [This is *colored* text]{color=red}
    

The attributes can be intercepted in a filter which can do
as it likes with the contents.

This has been quite a flexible system, and it degrades well
(in pandoc) when you don’t have the filter.