From c1ddff1b6f3d380945c0d74ab7c9d580ec155b97 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 14 Dec 2015 11:34:44 -0800 Subject: [PATCH] Add further warning re defaultValue and nullValue. This is not the first time someone has been confused by this. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 106ce74..310fcf8 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,10 @@ Mustache.compiler().nullValue("what").compile(tmpl).execute(map); // throws MustacheException when executing the template because doesNotExist cannot be resolved ``` +**Do not** use both `defaultValue` and `nullValue` in your compiler configuration. Each one +overrides the other, so whichever one you call last is the behavior you will get. But even if you +accidentally do the right thing, you have confusing code, so don't call both, use one or the other. + ### Sections Sections are not affected by the `nullValue()` or `defaultValue()` settings. Their behavior is