Rendering Behavior
Lis Novel renders prompts to keep templates resilient while you iterate: missing variables or functions do not throw errors, and missing tags are preserved in the output, normalized to the parsed expression.
Example:
- Template:
{ missingVar } - Output:
{missingVar}
Missing values inside expressions
Missing identifiers resolve to undefined inside expressions.
{missingVar + "x"}rendersx{missingVar is "x"}rendersfalse
Null-safe member access
When chaining properties, Lis Novel treats missing objects as null instead of throwing. This means the output is suppressed (empty string) rather than preserved as a placeholder.
Example:
- First scene in a novel:
{scene.previous.fullText}→''(empty output)
If you want a fallback, guard it explicitly:
{#if scene.previous}
{scene.previous.fullText}
{#else}
This is the first scene.
{#endif}
Undefined output rule
In Lis Novel, any expression that evaluates to undefined renders the normalized {expression} placeholder rather than an empty string. If you want no output, return null or '' from helpers.
If you build your own helpers, return null when you want to suppress output entirely.
Output trimming
Each rendered prompt message is trimmed, so leading and trailing whitespace is removed.
XML escaping
Lis Novel escapes XML attribute values (quotes, &, <, >) but does not escape element content. Text inside XML tags is emitted as-is across XML helpers such as {novel.outline}, {scene.fullText}, {storySoFar}, and {storyToCome}. If your downstream system needs fully escaped XML, escape those values explicitly in your template or post-process the output.
Scene numbering
Scene numbering is canonical across all prompt tags that emit scene numbers. Within a chapter, scenes are ordered by position, then by id, and numbered starting at 1.