Commit Graph

170 Commits

Author SHA1 Message Date
Michael Bayne d1384cd049 Reworked user-defined escaping to suit my tastes. 2013-08-01 16:01:31 -07:00
Nat Pryce 0797c89c38 Fixed formatting in README 2013-07-22 22:46:29 +01:00
Nat Pryce 30907579eb README describes user-extensible escaping rules (not just HTML or no escaping) 2013-07-22 22:45:28 +01:00
Nat Pryce 4ae290fdaa User-extensible escaping rules (not just HTML or no escaping) 2013-07-22 22:36:51 +01:00
Michael Bayne 9441d062a6 Moved falsey-ness detection into compiler.
Fixes #39.

This fixes a bug where falsey values were not properly triggering inverted
sections, and consolidates some logic.

Also did some renaming. Couldn't help myself.
2013-07-03 16:48:09 -07:00
Michael Bayne 6e3051c3ba Some tidying, added a negative test, method tests.
The latter was because the new feature was not actually conditional on its
compiler parameter. It was on all the time.
2013-05-13 13:22:45 -07:00
Mickael Jeanroy 4300b1213e Add option to treat zero as a falsy value
In javascript implementation, zero is a falsy value and is treated as a false boolean.
An option is added (false by default) to treat zero as a falsy value as in javascript implementation.

It means that section like:

{{#zeroValue}}foo{{/zeroValue}}

will not be rendered.
2013-05-08 22:24:40 +02:00
Michael Bayne 426faf92c5 Do our save/restore slightly differently. 2013-05-03 10:12:00 -07:00
David Loehr 751f671fd6 Reset compiler.delims after parsing a template 2013-05-03 11:57:53 -04:00
Michael Bayne 158b34f041 Update links to 1.8 artifact. 2013-04-05 11:07:41 -07:00
Michael Bayne 3baec8221d [maven-release-plugin] prepare for next development iteration 2013-04-05 11:03:35 -07:00
Michael Bayne 23c9ed91c8 [maven-release-plugin] prepare release jmustache-1.8 2013-04-05 11:03:26 -07:00
Michael Bayne 9d77d492b0 Expose NO_FETCHER_FOUND as custom fetchers may wish to return it. 2013-04-05 11:01:37 -07:00
Michael Bayne 4b1af351ae A note to self and minor comment tweak. 2013-04-02 12:54:20 -07:00
Michael Bayne 7e414b6c95 Use latest JUnit. 2013-04-02 12:54:20 -07:00
Michael Bayne c268d41594 Handle CR when skipping newlines. 2013-04-02 12:54:20 -07:00
Yoryos Valotasios 2889ee8692 Added standard Mustache specs tests suite.
The groups with failing tests are currently commented out (everything except
interpolation). The main reason for failures are due to the requirement that
standalone lines that contain nothing but whitespace be stripped from the
output.
2013-04-02 12:54:20 -07:00
Michael Bayne 3a5da915e9 These days I always cuddle method braces. 2013-03-27 10:37:41 -07:00
Michael Bayne fe2664627f A few tweaks to default delims patch (and some tidying):
- triple-stache mode reverted to only work with {{{ }}} rather than working
  with whatever default delims you set; I think this is more in the spirit of
  the Mustache spec

- Compiler.withDelims takes a delims string rather than the internal Delims
  class which callers don't care about or have access to

- nixed Delims constructors, made updateDelims fluent

- nixed DelimsTest, it wasn't testing anything that wasn't also already tested
  by the functional tests in MustacheTest
2013-03-27 10:29:57 -07:00
hierynomus 80217949e3 Fixes #33: Provide custom delimiters to the compiler 2013-03-27 09:23:15 +01:00
Yoryos Valotasios ffce9032cc Added travis.yml 2013-03-21 23:52:37 +01:00
Yoryos Valotasios fb5739d994 Ignore .metadata 2013-03-21 23:46:29 +01:00
Whymarrh Whitby 2701211e11 Small spelling fix. 2013-03-15 17:57:12 -07:00
Michael Bayne d215612d9a Merge pull request #29 from bruckner/master
Fixes issue 28, comments containing '}' parsed as text
2013-03-06 12:59:46 -08:00
Daniel Bruckner f92509a872 fixes #28 2013-03-06 12:46:36 -08:00
Michael Bayne 43db03a26a Changed MustacheContextException -> MustacheException.Context.
Also made data into final fields. I don't like unnecessary getters.
2013-03-05 20:55:01 -08:00
pmenhart c61650734d Added MustacheContextException
Solving need to distinguish context errors from environment errors.
  The exception has fields for the offending key and line number. This
  is a first step towards internationalization of messages.
2013-03-05 23:33:48 -05:00
Michael Bayne f3afcda74f [maven-release-plugin] prepare for next development iteration 2013-02-27 10:24:27 -08:00
Michael Bayne 96020e46de [maven-release-plugin] prepare release jmustache-1.7 2013-02-27 10:24:18 -08:00
Michael Bayne 1d7021b753 Fixed typo. 2013-02-15 16:41:24 -08:00
Michael Bayne aa56e72513 Truth in exampling. 2013-02-15 16:40:59 -08:00
Michael Bayne acbddd07a2 Added basic lambda support. 2013-02-15 16:38:36 -08:00
Michael Bayne be21def381 Oops, these were missing @Test annotations. 2013-02-15 16:08:06 -08:00
Michael Bayne 8f87bf374d Some tweaks to the 'substitute name into null value' patch. 2013-01-23 17:43:46 -08:00
pmenhart 8b0d063ffd Show the name of variable that is null or missing
If Compliler.nullValue contains a substring "{{name}}", then this substring
will be replaced with the name of variable.
For example, if nullValue="?{{name}}?" and variable is resolved to null,
then string "?foo?" will be used.
2013-01-23 15:59:52 -05:00
Michael Bayne 6e71dad5f2 Simplify logic now that null is always returned. 2012-12-04 16:48:23 -08:00
Michael Bayne 027a640bc4 Tidying. 2012-12-04 16:45:55 -08:00
Michael Bayne e588f2edf0 Clarify null-shadowing test a bit further with Object context version. 2012-12-04 16:45:32 -08:00
Michael Bayne 65f8d12d62 Merge pull request #22 from tominsam/master
allow inner null values to mask parent context values
2012-12-04 16:38:13 -08:00
Michael Bayne 31190d3cb5 Made createFetcherCache abstract.
GWT doesn't provide Collections.synchronizedMap so we can't default to that.
Because we don't want someone to extend BasicCollector on a multi-threaded
platform and get an unsynchronized HashMap, which would cause things to fail,
we instead make creatFetcherCache abstract and document that if you extend
BasicCollector, you need to return a synchronized map (if the platform you're
targeting is multithreaded).
2012-10-03 09:51:26 -07:00
Michael Bayne 4926b326b9 Preserve Java 5 compatibility. Yay! 2012-10-01 14:14:23 -07:00
Michael Bayne 5ec24e947c Use ConcurrentHashMap to cache fetchers, on platforms that support it. 2012-10-01 09:27:36 -07:00
Tom Insam 2b337b8770 null values can shadow parent context now. Improve test a little. 2012-08-22 15:19:00 +01:00
Tom Insam 718218098f test for masking parent contexts with false keys. 2012-08-22 14:20:58 +01:00
Michael Bayne 41eec508cb [maven-release-plugin] prepare for next development iteration 2012-08-16 17:53:52 -07:00
Michael Bayne 21f2145222 [maven-release-plugin] prepare release jmustache-1.6 2012-08-16 17:53:45 -07:00
Michael Bayne 9f0bb84db3 Prep for 1.6 release. 2012-08-16 17:38:41 -07:00
Michael Bayne 69a772ab98 Preserve nesting with non-empty strings; tidying. 2012-08-13 14:36:17 -07:00
Michael Bayne a899c466ca Use latest test plugin. 2012-08-13 14:31:23 -07:00
Michael Bayne c10bb817da Merge pull request #20 from mick8569/master
Add option to treat empty string as falsy values
2012-08-13 14:18:38 -07:00