# Generic directives/plugins syntax

**URL:** <https://talk.commonmark.org/t/generic-directives-plugins-syntax/444>\
**Category:** Extensions\
**Created:** [September 6, 2014, 9:50am UTC](https://talk.commonmark.org/t/generic-directives-plugins-syntax/444 "2014-09-06T09:50:24Z")\
**Posts on this page:** 1\
**Showing post:** 113

<div class="post-metadata">

**Author:** ![tabatkins](https://talk.commonmark.org/user_avatar/talk.commonmark.org/tabatkins/32/80_2.png) [@tabatkins](https://talk.commonmark.org/u/tabatkins)\
**Post date:** [November 13, 2014, 6:18pm UTC](https://talk.commonmark.org/t/generic-directives-plugins-syntax/444/113 "2014-11-13T18:18:51Z")

</div>

> Oh, obviously it’s exactly the other way,

The problem is that you currently have to search forward an arbitrary number of lines to tell whether the directive is a leaf or a container. That’s not very good for parsing; ideally you have a finite amount of lookahead (right now, parsing MD requires 1 or 2 lines of lookahead, depending on your strategy in some cases). It also means that you wont’ be able to use a bare `:::` without any further arguments to just mean “div”, as that would also trigger the “I’m a container!” behavior of a preceding block directive.

It would be better if there was some way to distinguish containers from leaves in the first line, or the line after. That’s why I suggested “blank line after” to mean leaf; it seems consistent with how we handle other types of blocks, and is easy to learn. (“end of container block” would also work, obviously, for those blocks where that’s unambiguous.)

> btw, I’m the OP

I know, I was using it to mean “original _post_”, to specifically point at the first post in the thread for clarity.

---

_[View the full topic](https://talk.commonmark.org/t/generic-directives-plugins-syntax/444)._
