Closed jgonggrijp closed 3 years ago
Indeed, interpolating NULL to the empty string reflects the consensus in #101 (among a small group of participants), and is highly consistent (unlike "null") with the following existing parts of the interpolation specification:
If any part fails resolution, the result should be considered falsey, and should interpolate as the empty string. Data should be coerced into a string (and escaped, if appropriate) before interpolation.
I'm in favor of merging this change.
Agreed, seems like an unfortunate oversight. Does anyone know of a Mustache implementation that interpolates null
to something other than an empty string? I know it was mentioned in #101 but the poster did not specify which implementation.
As a side note, I think it would be beneficial to add a test for null being falsey.
As a side note, I think it would be beneficial to add a test for null being falsey.
Oh, right. Shall I add that in here?
I'd consider it a part of "interpolating null", so yeah throw the test case in this pr.
There you go!
Would you mind to review https://github.com/mustache/mustache/pull/266?
bump!
Reviewed! Sorry for the delay.
Merged & tagged in v1.2.1
Thanks!
See discussion in #101.