Zettelmarkup: Inline-mode Transclusion

Inline-mode transclusion applies to all zettel that are parsed in a non-trivial way, e.g. as structured textual content. For example, textual content is assumed if the syntax of a zettel is “zmk” (Zettelmarkup), or “markdown” / “md” (Markdown).

Since this type of transclusion is at the level of inline-structured elements, the transclude specification must be replaced with some inline-structured elements.

First, the referenced zettel is read. If it contains other transclusions, these will be expanded, recursively. When an endless recursion is detected, expansion does not take place. Instead an error message replaces the transclude specification.

The result of this (indirect) transclusion is searched for inline-structured elements.

If no inline-structured elements are found, the transclude specification is replaced by an error message.

To avoid an exploding “transclusion bomb”, a form of a billion laughs attack (also known as “XML bomb”), the total number of transclusions / expansions is limited. The limit can be controlled by setting the value max-transclusions of the runtime configuration zettel.

See also

Full transclusion does not work inside some text, but is used for block-structured elements.