Yotam Madem
d820d254e5
Fix indentation of inline partials ( #716 )
These changes fixes an indentation bug introduced when partials was
made to also be indented like its parent template. When partials are
rendered inline, it should not be indented with the amount of indentation
that the line already has.
Fixes https://github.com/janl/mustache.js/issues/715
Refs https://github.com/janl/mustache.js/pull/705
6 lat temu
Kevin Dew
cadf571488
Indent Partials
As referenced in this issue:
https://github.com/janl/mustache.js/issues/562
Partials aren't indented as per the spec:
https://github.com/mustache/spec/blob/master/specs/partials.yml#L13-L15
This adds indentation tracking for partials and applies them to the
first instance of a partial on a line (to not indent inline partials
which would violate a different part of the spec).
9 lat temu
Phillip Johnsen
bb700c5433
Start linting all test/ files as part of test script ( #704 )
In an effort of ensuring consistent code style in test files as with
the "production" source code, we should run eslint as part of the
`$ npm test` script as well.
Most of the related fixes was done by `eslint` using the `--fix` argument.
Only special configuration tweaks for tests compared to the other
source code, is to allow functions declaration without names. The
rationale for allowing that in tests, is that the important reason we
have them in the source code (proper stacktraces) aren't as important
in test files.
6 lat temu
raymond.lam
78458488a4
Reintroduce pull requests #643 and #664, and update description for
parse method
7 lat temu
Raymond Lam
5acafd33c6
Fix custom tags by rolling back #643 & #664 ( #670 )
Pull requests #643 and #664 together fix the issue reported in issue #617, but the change in behavior is causing semvers concerns. See issue #669 . Therefore, roll back #643 and #664 and later reintroduce in next planned major release (v3.0).
Fixes #669
7 lat temu
Ashinoko
28ca619a24
fix bug: cache actually not working ( #664 )
Resolve issue #663 and add test.
7 lat temu
raymond.lam
198a5657be
fix typo in parse-caching/Mustache.tags test
8 lat temu
raymond.lam
24653984d0
Writer.prototype.parse to cache by tags in addition to template string
9 lat temu
Michael Jackson
b114120741
Major reorganization and cleanup
12 lat temu
Michael Jackson
eb6ceb8b14
Fixed rendering error when using nested higher-order sections
Fixes #274
13 lat temu
Michael Jackson
eee8d695fc
Better error reporting
13 lat temu
Michael Jackson
3fea961f06
Use mocha for testing
13 lat temu
Michael Jackson
e0edb356ae
Fail gracefully on empty template
Fixes #267
13 lat temu
Michael Jackson
0ea95746a8
Allow auto-loading of partials
Fixes #247
13 lat temu
Michael Jackson
a5dbb708d7
Fix text token offsets
Text tokens now accurately reflect their content's exact position
in the original template.
13 lat temu
Michael Jackson
18e797d47e
Coerce { token types to &
13 lat temu
Michael Jackson
3fb61fc056
More concise token format
13 lat temu
Michael Jackson
be4fd1cc29
Text passed to higher-order sections unrendered
Fixes #187
13 lat temu
Michael Jackson
fbc66a8140
Another rewrite
- Cleaner separation of responsibilities in the code between
scanning, parsing, compiling, and rendering functions.
- Much faster
14 lat temu