(zettel (meta (back "00001006000000 00001007031110 00001007040320 00001007990000") (backward "00001006000000 00001007031110 00001007040320 00001007040350 00001007990000") (box-number "1") (created "20210811154251") (forward "00001006050000 00001007000000 00001007030000 00001007030300 00001007031100 00001007040000 00001007040350 00001008010000 00010000000000") (modified "20251108163237") (published "20251108163237") (role "manual") (syntax "zmk") (tags "#manual #zettelmarkup #zettelstore") (title "Zettelmarkup: Inline-mode Transclusion")) (rights 4) (encoding "") (content "Inline-mode transclusion is applied to any zettel that is parsed in a non-trivial way, such as when the content is structured text.\nFor instance, this applies to zettel written in [[Zettelmarkup|00001007000000]] or [[Markdown|00001008010000]].\n\nSince this type of transclusion involves [[inline-structured elements|00001007040000]], the transclusion specification must be replaced with an appropriate inline-structured content.\nSpecifically, the transclusion specification is replaced with an [[inline span|00001007040100#inline-span]] containing the inline-structured content.\n\nThe process begins by reading the referenced zettel.\nIf the zettel contains other transclusions, these will be expanded recursively.\nIf an infinite recursion is detected, the expansion is halted, and an error message replaces the transclusion specification.\n\nThe result of this (indirect) transclusion is searched for inline-structured elements.\n\n* If only a [[zettel identifier|00001006050000]] was specified, the first top-level [[paragraph|00001007030000#paragraphs]] is used.\n Since a paragraph is basically a sequence of inline-structured elements, these elements will replace the transclude specification.\n\n Example: ``{{00010000000000}}`` (see [[00010000000000]]) is rendered as ::{{00010000000000}}::{=example}.\n\n* If a fragment identifier was additionally specified, the element with the given fragment is searched:\n** If it specifies a [[heading|00001007030300]], the next top-level paragraph is used.\n\n Example: ``{{00010000000000#reporting-errors}}`` is rendered as ::{{00010000000000#reporting-errors}}::{=example}.\n\n** In case the fragment names a [[mark|00001007040350]], the inline-structured elements after the mark are used.\n Initial spaces and line breaks are ignored in this case.\n\n Example: ``{{00001007040322#spin}}`` is rendered as ::{{00001007040322#spin}}::{=example}.\n\n** Just specifying the fragment identifier will reference something on the current page.\n This is not allowed, to prevent a possible endless recursion.\n\n* If the reference is a [[hosted or based|00001007040310#link-specifications]] link / URL to an image, that image will be rendered.\n\n Example: ``{{//z/00000000040001}}{alt=Emoji}`` is rendered as ::{{//z/00000000040001}}{alt=Emoji}::{=example}\n\nIf no inline-structured elements are found, the transclude specification is replaced by an error message.\n\nTo avoid an exploding \"\"transclusion bomb\"\", a form of [[billion laughs attack|https://en.wikipedia.org/wiki/Billion_laughs_attack]] (also known as \"\"XML bomb\"\"), the total number of transclusions / expansions is limited.\nThe limit can be controlled by setting the value [[''max-transclusions''|00001004020000#max-transclusions]] of the runtime configuration zettel.\n\n=== See also\n[[Full transclusion|00001007031100]] does not work inside some text, but is used for [[block-structured elements|00001007030000]]."))