mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
Implement lenientIf option (resolve #265; default off)
See description of the option in liquid-options.ts.
This commit is contained in:
committed by
Jun Yang
parent
c920ebb282
commit
768fb79e32
@@ -19,6 +19,8 @@ export interface LiquidOptions {
|
||||
strictFilters?: boolean;
|
||||
/** Whether or not to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */
|
||||
strictVariables?: boolean;
|
||||
/** Modifies the behavior of `strictVariables`. If set, a single undefined variable will *not* cause an exception in the context of the `if` tag and the `default` filter. Instead, it will evaluate to `false` and `null`, respectively. Irrelevant if `strictVariables` is not set. Defaults to `false`. **/
|
||||
lenientIf?: boolean;
|
||||
/** Strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */
|
||||
trimTagRight?: boolean;
|
||||
/** Similar to `trimTagRight`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
|
||||
@@ -56,6 +58,7 @@ export interface NormalizedFullOptions extends NormalizedOptions {
|
||||
dynamicPartials: boolean;
|
||||
strictFilters: boolean;
|
||||
strictVariables: boolean;
|
||||
lenientIf: boolean;
|
||||
trimTagRight: boolean;
|
||||
trimTagLeft: boolean;
|
||||
trimOutputRight: boolean;
|
||||
@@ -85,6 +88,7 @@ export const defaultOptions: NormalizedFullOptions = {
|
||||
outputDelimiterRight: '}}',
|
||||
strictFilters: false,
|
||||
strictVariables: false,
|
||||
lenientIf: false,
|
||||
globals: {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user