diff --git a/doc/apiref.rst b/doc/apiref.rst index 9c29c79..f8c27f7 100644 --- a/doc/apiref.rst +++ b/doc/apiref.rst @@ -866,6 +866,12 @@ can be ORed together to obtain *flags*. output. If ``JSON_INDENT`` is not used or *n* is 0, no newlines are inserted between array and object items. + The ``JSON_MAX_INDENT`` constant defines the maximum indentation + that can be used, and its value is 31. + + .. versionchanged:: 2.7 + Added ``JSON_MAX_INDENT``. + ``JSON_COMPACT`` This flag enables a compact representation, i.e. sets the separator between array and object items to ``","`` and between object keys diff --git a/src/jansson.h b/src/jansson.h index bcb2087..80ab05f 100644 --- a/src/jansson.h +++ b/src/jansson.h @@ -259,7 +259,8 @@ json_t *json_load_callback(json_load_callback_t callback, void *data, size_t fla /* encoding */ -#define JSON_INDENT(n) ((n) & 0x1F) +#define JSON_MAX_INDENT 0x1F +#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT) #define JSON_COMPACT 0x20 #define JSON_ENSURE_ASCII 0x40 #define JSON_SORT_KEYS 0x80