Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add a test for not interpolating rendered section output #32

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

cjerdonek commented Jan 5, 2012

In contrast to lambda return values, the output of rendering a section should not be parsed. I think a test case would be helpful here to draw a distinction with that behavior. Test case included.

The attached test case would also clarify that nested sections should be evaluated "outside-in" rather than "inside-out." For example--

data: { outer: true, inner: true, template: '{{planet}}', planet: 'Earth'}
template: '{{#outer}}{{planet}} : Interpolate? {{#inner}}{{template}}{{/inner}}{{/outer}}'

groue commented Jan 5, 2012

Very interesting test, quite related to issue #19.

Contributor

pvande commented Jan 5, 2012

Good catch on both this and #31; the latter is covered implicitly (read: accidentally) by the specs for dotted names, but both of these are clearly oversights in the spec at large. I'll get these merged into both the v1.0.x and v1.1.x specs soon.

Thanks!

Contributor

cjerdonek commented Jan 5, 2012

Thanks, @pvande and @groue. groue, on the subject of related issues, I arrived at this test case in the process of thinking about issue #30 -- specifically the order in which lambdas should be evaluated that occur in nested sections (descending towards the leaves in the depth-first traversal or ascending up from them).

I may have one more test case to offer that is similarly related -- on the subject of lambdas.

@cjerdonek cjerdonek added a commit to cjerdonek/mustache-spec that referenced this pull request May 3, 2012

@cjerdonek cjerdonek Merge remote-tracking branch 'v1.0.3+section-non-interpolation' into …
…development

See issue #32: mustache#32
2aa6e8c

@pombredanne pombredanne pushed a commit to pombredanne/pystache that referenced this pull request Nov 1, 2013

@cjerdonek cjerdonek Added two rendering test cases re: sections.
The two test cases test, respectively, (1) context precedence and
(2) that section output not be rendered.  The two test cases were
originally proposed for inclusion in the Mustache spec test cases
in mustache/spec issues #31 and #32:

* mustache/spec#31
* mustache/spec#32
804c871

@mihais mihais pushed a commit to android-ia/platform_external_pystache that referenced this pull request May 7, 2015

@cjerdonek cjerdonek Added two rendering test cases re: sections.
The two test cases test, respectively, (1) context precedence and
(2) that section output not be rendered.  The two test cases were
originally proposed for inclusion in the Mustache spec test cases
in mustache/spec issues #31 and #32:

* mustache/spec#31
* mustache/spec#32
29ecbad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment