Kieling
a5920c37b3
Pipeline with recursive search. To take a function with parent
7 yıl önce
Kieling
47e3003b87
Added pipeline helper, with tests
Can write with | and |> to use this function.
7 yıl önce
Raymond Lam
a2699e4673
Allow rendering properties of primitive types that are not objects ( #618 )
* prevent value from being returned by Context.prototype.lookup if lookupHit is false
* add test for renderability of Array.length via dot notation
* Remove `typeof obj === 'object'` constraint in prop lookup
Allows rendering properties of primitive types that are not objects, such as a string.
* pop lookup needs to use hasOwnProperty for non-objs
* re-add constraint in prop lookup, but make property lookups for primitives possible through dot notation
* add test to address #589 specifically
* enhance readability of primitiveHasOwnProperty and add comments to explain why it is used in one case but not the other
7 yıl önce
David da Silva
7e83df9b05
Assert `null` value render
It was not being asserted anywhere else, and I was suspecting that
PR #552 was changing current (and correct) behaviour.
10 yıl önce
David da Silva
5e19b3049b
Add consistent indentation in null_lookup_object.js test file
Either vim or git was going crazy with the indentation when I tried
improving the test via changing one of the lines, so I linted it all
together.
10 yıl önce
wizawu
c71fc6ff6b
Remove test/_files/cli_output.txt
10 yıl önce
wizawu
3165c53f7f
Add test case for `output` argument
10 yıl önce
Phillip Johnsen
378bcca8a5
Improve HTML escaping.
This closes a couple of potential exploit scenarios.
Backtick (`) for older IEs and equals (=) for unquoted attributes.
Refs 83b8e846a3
Closes https://github.com/janl/mustache.js/pull/388
10 yıl önce
palkan
d0cf9c65ee
[ Fix #483 ] Add partials support to cli
10 yıl önce
David da Silva
931f49b5da
improve test with undefined/null lookup hit using dot notation
11 yıl önce
Phillip Johnsen
fc6d73b353
Bugfix for using values from view's context prototype.
Fixes #445
11 yıl önce
Phillip Johnsen
e801e842a7
Bugfix for view context cache picking methods from Object.prototype instead of the view.
Fixes #442
11 yıl önce
Phillip Johnsen
32935dc09b
Bugfix for number rendered as [object Object]
+ minor fix for better error message when running specific render test
Fixes #415
11 yıl önce
David da Silva
a0204307c6
fixing null and undefined lookup, fixes #390, #397, #409
11 yıl önce
Phillip Johnsen
65387a5468
Created command line tool.
CLI used to render a mustache template with a data view, writes the template into stdout when successfull. Otherwise meaningfull errors into stderr.
Fixes #424
11 yıl önce
Chris Buckley
d9aa703014
Only access properties of objects on Context.lookup
12 yıl önce
Lakshan Perera
42ec324c8f
When rendering partials, pass the partial template instead of the original template.
12 yıl önce
Michael Jackson
da16eada83
Allow a string to act as context
Fixes #321
12 yıl önce
Michael Jackson
411edae061
Fix [object Object] errors
Fixes #322
Fixes #330
Fixes #331
Fixes #334
12 yıl önce
Michael Jackson
af935e3441
Simplify test
13 yıl önce
Michael Jackson
b9701d58f5
Add failing test for nested higher-order sections
13 yıl önce
Matt Sacks
d59f02f622
Don't evaluate lambdas that return falsy values as an empty string.
Issue: If I create a Mustache lambda to return numbers and I expect 0 to be of
those numbers, I'll instead only receive an empty string for 0 because it
evaluates to falsy.
Fix: Check the result of the lambda to be undefined or null. Only then should
it return the empty string.
13 yıl önce
Michael Jackson
0a6d71ca90
Add tests for null view
13 yıl önce
Michael Jackson
be4fd1cc29
Text passed to higher-order sections unrendered
Fixes #187
13 yıl önce
Michael Jackson
5ab345eddf
Use JavaScript's definition of falsy
Fixes #186
13 yıl önce
Michael Jackson
a8a0392cd6
Added 3-level deep nesting test
Fixes #42
13 yıl önce
Michael Jackson
a7a6e742d1
Use @cweider's quoting function
Also fixed a bug that occurs when using the triple-stache with a key
that contains a closing stache. Fixes #192 .
14 yıl önce
Michael Jackson
b8a14eafe9
Strict escaping of ampersands
14 yıl önce
Michael Jackson
8efd0538cf
This test should not work
14 yıl önce
Michael Jackson
fbc66a8140
Another rewrite
- Cleaner separation of responsibilities in the code between
scanning, parsing, compiling, and rendering functions.
- Much faster
14 yıl önce