Jan Lehnardt
a6de1a3bdd
add inverted sections. Closes #17 and #24 . Patch by defunkt.
před 16 roky
Jan Lehnardt
8df3bef014
don't doublt encode entities. Closes #19 . Patch by Leeoniya
před 16 roky
Jan Lehnardt
2085b5f5a0
allow using sections as context. Patch by dpree.
před 16 roky
Chris Wanstrath
e2e8f16845
Higher Order Sections
If a section key returns a function, it will be called
and passed both the unrendered block of text and a renderer
convenience function.
Given this JS:
"name": "Tater",
"bolder": function() {
return function(text, render) {
return "<b>" + render(text) + '</b>'
}
}
And this template:
{{#bolder}}Hi {{name}}.{{/bolder}}
We'll get this output:
<b>Hi Tater.</b>
As you can see, we're pre-processing the text in the block.
This can be used to implement caching, filters (like syntax
highlighting), etc.
You can use `this.name` to access the attribute `name` from
your view.
před 16 roky
Jan Lehnardt
4694868fdc
don't barf on undefined partial contexts, return the verbatim partial instead
před 16 roky
Jan Lehnardt
eaaae4696b
clean up tests
před 16 roky
Damien Mathieu
2d574f70dc
add a (failing for now) example of loop inside a partial
před 16 roky
Jan Lehnardt
cb39d246df
throw exception when encountering an unknown pragma
před 16 roky
Elise Wood
6324de20c6
tests for null value change
před 16 roky
Jan Lehnardt
88ddf16cec
allow tag-free templates. Closes http://github.com/janl/mustache.js/issues#issue/9
před 16 roky
Jan Lehnardt
17630842a1
add pragma options, rename pragma according to mustache
před 16 roky
Jan Lehnardt
d0d46e52aa
make mustache streaming
před 16 roky
Jan Lehnardt
ec18e0eff4
spaces, not tabs
před 16 roky
Jan Lehnardt
0bb4776def
mustache compat: Don't barf on unknown variables.
před 16 roky
Jan Lehnardt
b579404912
s/ENABLE-STRING-ARRAYS/JSTACHE-ENABLE-STRING-ARRAYS/
před 16 roky
Jan Lehnardt
1fa8421678
make strings of arrays a pragma option, introduce {{%PRAGMA}} tag to enable features
před 16 roky
Jan Lehnardt
176b0111fe
ctemplate / mustache compat: partials now use >, not <
před 16 roky
Paul J. Davis
895e741234
Fix error message consistency.
před 16 roky
Paul J. Davis
3a9eda10b4
Avoid requiring partials in global scope.
před 16 roky
Chris Williams
a096578f99
Fixing trailing white space sensitivity for reusable enumerable spec.
před 16 roky
Chris Williams
68830cadff
Updated the render_segment to allow for the same variable to be reused for multiple template segments. Added a map function that can be used if not available on array natively - ahem IE ahem
před 16 roky
Sebastian Cohnen
45948113fa
Fixed changing the delimiter
Changing the delimiter and use the new one on the
same line was broken. Fixed that and extended the
test suite.
před 16 roky
Sebastian Cohnen
c8c378c4f5
Rewritten render_tags, added test for two placeholder in one row
před 16 roky
Alexander Lang
093a5b84da
fixed bug where recursion overwrote data in the parent context
před 16 roky
Alexander Lang
437056a7e7
added processing arrays of plain values
před 16 roky
Jan Lehnardt
712e78bd17
allow for delimiter changes
před 16 roky
Jan Lehnardt
0a466bfce3
add mustache tests, implement partials
před 16 roky
Jan Lehnardt
50f8035e3e
add test suite, implement escaping
před 16 roky
Jan Lehnardt
0e11ce9ee5
initial drop
před 16 roky