@rhinostone/swig 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changes/unreleased/.gitkeep +0 -0
- package/.changes/v0.1.2.md +6 -0
- package/.changes/v0.1.3.md +6 -0
- package/.changes/v0.1.5.md +11 -0
- package/.changes/v0.1.6.md +6 -0
- package/.changes/v0.1.7.md +7 -0
- package/.changes/v0.1.8.md +7 -0
- package/.changes/v0.1.9.md +7 -0
- package/.changes/v0.10.0.md +11 -0
- package/.changes/v0.11.0.md +15 -0
- package/.changes/v0.11.1.md +6 -0
- package/.changes/v0.11.2.md +6 -0
- package/.changes/v0.12.0.md +7 -0
- package/.changes/v0.12.1.md +11 -0
- package/.changes/v0.13.0.md +8 -0
- package/.changes/v0.13.1.md +8 -0
- package/.changes/v0.13.2.md +9 -0
- package/.changes/v0.13.3.md +5 -0
- package/.changes/v0.13.4.md +5 -0
- package/.changes/v0.13.5.md +4 -0
- package/.changes/v0.14.0.md +6 -0
- package/.changes/v0.2.0.md +7 -0
- package/.changes/v0.2.1.md +6 -0
- package/.changes/v0.2.2.md +6 -0
- package/.changes/v0.2.3.md +10 -0
- package/.changes/v0.3.0.md +6 -0
- package/.changes/v0.4.0.md +11 -0
- package/.changes/v0.5.0.md +11 -0
- package/.changes/v0.6.0.md +12 -0
- package/.changes/v0.6.1.md +6 -0
- package/.changes/v0.7.0.md +7 -0
- package/.changes/v0.8.0.md +18 -0
- package/.changes/v0.9.0.md +13 -0
- package/.changes/v0.9.1.md +6 -0
- package/.changes/v0.9.2.md +6 -0
- package/.changes/v0.9.3.md +6 -0
- package/.changes/v0.9.4.md +10 -0
- package/.changes/v1.0.0-pre1.md +22 -0
- package/.changes/v1.0.0-pre2.md +18 -0
- package/.changes/v1.0.0-pre3.md +7 -0
- package/.changes/v1.0.0-rc1.md +12 -0
- package/.changes/v1.0.0-rc2.md +10 -0
- package/.changes/v1.0.0-rc3.md +7 -0
- package/.changes/v1.0.0.md +7 -0
- package/.changes/v1.1.0.md +6 -0
- package/.changes/v1.2.0.md +10 -0
- package/.changes/v1.2.1.md +4 -0
- package/.changes/v1.2.2.md +4 -0
- package/.changes/v1.3.0.md +14 -0
- package/.changes/v1.3.2.md +6 -0
- package/.changes/v1.4.0.md +13 -0
- package/.changes/v1.4.1.md +5 -0
- package/.changes/v1.4.2.md +10 -0
- package/.changes/v1.4.3.md +4 -0
- package/.changes/v1.4.4.md +6 -0
- package/.changie.yaml +26 -0
- package/.eslintrc.json +17 -0
- package/AUTHORS +61 -0
- package/HISTORY.md +510 -0
- package/ISSUE_TEMPLATE.md +5 -0
- package/LICENSE +22 -0
- package/PULL_REQUEST_TEMPLATE.md +3 -0
- package/README.md +84 -0
- package/bin/swig.js +162 -0
- package/dist/swig.js +5068 -0
- package/dist/swig.min.js +19 -0
- package/dist/swig.min.js.map +1 -0
- package/index.js +1 -0
- package/lib/dateformatter.js +198 -0
- package/lib/filters.js +663 -0
- package/lib/lexer.js +306 -0
- package/lib/loaders/filesystem.js +59 -0
- package/lib/loaders/index.js +53 -0
- package/lib/loaders/memory.js +63 -0
- package/lib/parser.js +762 -0
- package/lib/swig.js +740 -0
- package/lib/tags/autoescape.js +37 -0
- package/lib/tags/block.js +25 -0
- package/lib/tags/else.js +25 -0
- package/lib/tags/elseif.js +28 -0
- package/lib/tags/extends.js +19 -0
- package/lib/tags/filter.js +68 -0
- package/lib/tags/for.js +130 -0
- package/lib/tags/if.js +86 -0
- package/lib/tags/import.js +94 -0
- package/lib/tags/include.js +100 -0
- package/lib/tags/index.js +16 -0
- package/lib/tags/macro.js +79 -0
- package/lib/tags/parent.js +51 -0
- package/lib/tags/raw.js +23 -0
- package/lib/tags/set.js +125 -0
- package/lib/tags/spaceless.js +34 -0
- package/lib/utils.js +184 -0
- package/package.json +73 -0
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.1.2](https://github.com/paularmstrong/swig/tree/v0.1.2) / 2011-09-01
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* Initial **swig** publish after forking from [node-t](https://github.com/skid/node-t)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.2/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.1.3](https://github.com/paularmstrong/swig/tree/v0.1.3) / 2011-09-01
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** filter parser to work correctly with single-quoted params in filters.
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.3/docs)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[0.1.5](https://github.com/paularmstrong/swig/tree/v0.1.5) / 2011-09-04
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** `first`, `last`, and `uniq` filters
|
|
5
|
+
* **Added** ability to specify custom filters
|
|
6
|
+
* **Added** ability to specify custom tags
|
|
7
|
+
* **Changed** slots removed -- implement using custom tags if desired
|
|
8
|
+
* **Fixed** ability to do either dot- or bracket-notation or mixed in variables
|
|
9
|
+
* **Fixed** internal parsing helpers
|
|
10
|
+
|
|
11
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.5/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.1.6](https://github.com/paularmstrong/swig/tree/v0.1.6) / 2011-09-04
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Template inheritance blocks messing up.
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.6/docs)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[0.1.7](https://github.com/paularmstrong/swig/tree/v0.1.7) / 2011-09-05
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** this History document
|
|
5
|
+
* **Fixed** date filter to zero-pad correctly during september when using 'm' format
|
|
6
|
+
|
|
7
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.7/docs)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[0.1.8](https://github.com/paularmstrong/swig/tree/v0.1.8) / 2011-09-10
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** `add`, `addslashes`, and `replace` filters.
|
|
5
|
+
* **Changed** All tags that 'end' must use named ends like `endblock`, `endif`, `endfor`, etc...
|
|
6
|
+
|
|
7
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.8/docs)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[0.1.9](https://github.com/paularmstrong/swig/tree/v0.1.9) / 2011-09-11
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** `allowErrors` flag will allow errors to be thrown and bubbled up. Default to catch errors.
|
|
5
|
+
* **Changed** Internal speed improvements.
|
|
6
|
+
|
|
7
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.1.9/docs)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[0.10.0](https://github.com/paularmstrong/swig/tree/v0.10.0) / 2012-02-13
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** loop.index0, loop.revindex, loop.revindex0, and loop.cycle [gh-48](https://github.com/paularmstrong/swig/issues/48)
|
|
5
|
+
* **Added** init config `extensions` for 3rd party extension access in custom tags [gh-44](https://github.com/paularmstrong/swig/issues/44)
|
|
6
|
+
* **Added** Whitespace Control [gh-46](https://github.com/paularmstrong/swig/issues/46)
|
|
7
|
+
* **Changed** The `empty` tag in `for` loops is now `else` [gh-49](https://github.com/paularmstrong/swig/issues/49)
|
|
8
|
+
* **Changed** `forloop` vars to `loop` closes [gh-47](https://github.com/paularmstrong/swig/issues/47)
|
|
9
|
+
* **Fixed** `include` tag's `with` and `only` args documentation [gh-50](https://github.com/paularmstrong/swig/issues/50)
|
|
10
|
+
|
|
11
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.10.0/docs)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[0.11.0](https://github.com/paularmstrong/swig/tree/v0.11.0) / 2012-02-27
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Support for Windows style paths [gh-57](https://github.com/paularmstrong/swig/issues/57)
|
|
5
|
+
* **Added** `ignore missing` tokens to include tag
|
|
6
|
+
* **Changed** include tag `with context` to only work if `context` is an object
|
|
7
|
+
* **Changed** `autoescape` tag controls no longer 'yes' or 'no'. Use `true` and `false`
|
|
8
|
+
* **Changed** parser is now passed into tags as an argument
|
|
9
|
+
* **Changed** don't require passing context object when rendering template
|
|
10
|
+
* **Fixed** dateformats `N` and `w` [gh-59](https://github.com/paularmstrong/swig/issues/59)
|
|
11
|
+
* **Fixed** number changing to string after add filter or set from variable [gh-53](https://github.com/paularmstrong/swig/issues/53) [gh-58](https://github.com/paularmstrong/swig/issues/58)
|
|
12
|
+
* **Fixed** speed decrease caused by loop.cycle fixed
|
|
13
|
+
* **Fixed** Ensure set tag bubbles through extends and blocks
|
|
14
|
+
|
|
15
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.11.0/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.11.1](https://github.com/paularmstrong/swig/tree/v0.11.1) / 2012-04-01
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Duplicate (string) tokens were being removed when extending a base template. [gh-67](https://github.com/paularmstrong/swig/issues/67)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.11.1/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.11.2](https://github.com/paularmstrong/swig/tree/v0.11.2) / 2012-04-10
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Update support for underscore@1.3.3 [gh-70](https://github.com/paularmstrong/swig/issues/70) [gh-71](https://github.com/paularmstrong/swig/issues/71)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.11.2/docs)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[0.12.0](https://github.com/paularmstrong/swig/tree/v0.12.0) / 2012-07-26
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Misc documenation
|
|
5
|
+
* **Changed** Support Node.js >=v0.6
|
|
6
|
+
|
|
7
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.12.0/docs)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[0.12.1](https://github.com/paularmstrong/swig/tree/v0.12.1) / 2012-10-05
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** More information on some parser errors
|
|
5
|
+
* **Added** indent parameter to json_encode filter to support pretty-printing.
|
|
6
|
+
* **Added** support for variables as `extends` tag parameters
|
|
7
|
+
* **Fixed** Compile errors in Android and other random browsers
|
|
8
|
+
* **Fixed** Misc documentation
|
|
9
|
+
* **Fixed** Leaking __keys variable into global scope
|
|
10
|
+
*
|
|
11
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.12.1/docs)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
[0.13.0](https://github.com/paularmstrong/swig/tree/v0.13.0) / 2012-10-20
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Support for nested blocks! [gh-64](https://github.com/paularmstrong/swig/issues/64) [gh-129](https://github.com/paularmstrong/swig/issues/129) ([nsaun](https://github.com/nsaun))
|
|
5
|
+
* **Changed** Removed the `parentBlock` argument from tags.
|
|
6
|
+
* **Fixed** Object keys may now contain dots
|
|
7
|
+
|
|
8
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.13.0/docs)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
[0.13.1](https://github.com/paularmstrong/swig/tree/v0.13.1) / 2012-10-28
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Macros should be preserved when using inheritence [gh-132](https://github.com/paularmstrong/swig/issues/132) ([nsaun](https://github.com/nsaun))
|
|
5
|
+
* **Fixed** bug in parent tag logic [gh-130](https://github.com/paularmstrong/swig/issues/130)
|
|
6
|
+
* **Fixed** Error messaging when parent block failed compilation [gh-129](https://github.com/paularmstrong/swig/issues/129) ([nsaun](https://github.com/nsaun))
|
|
7
|
+
|
|
8
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.13.1/docs)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[0.13.2](https://github.com/paularmstrong/swig/tree/v0.13.2) / 2012-10-28
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Allow variables, filters, arguments to span lines [gh-122](https://github.com/paularmstrong/swig/issues/122)
|
|
5
|
+
* **Changed** Throw Errors when using undefined filters [gh-115](https://github.com/paularmstrong/swig/issues/115)
|
|
6
|
+
* **Fixed** compiling files from absolute paths [gh-103](https://github.com/paularmstrong/swig/issues/103)
|
|
7
|
+
* **Fixed** Prevent global variables from being used before context variables [gh-117](https://github.com/paularmstrong/swig/issues/117)
|
|
8
|
+
|
|
9
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.13.2/docs)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
[0.13.3](https://github.com/paularmstrong/swig/tree/v0.13.3) / 2012-12-07
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Support % (modulus) in if tags [gh-155](https://github.com/paularmstrong/swig/pull/155)
|
|
5
|
+
* **Added** Support multi-root via array [gh-143](https://github.com/paularmstrong/swig/pull/143)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
[0.13.4](https://github.com/paularmstrong/swig/tree/v0.13.4) / 2012-12-19
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Runaway loop on missing template [gh-162](https://github.com/paularmstrong/swig/pull/162) [gh-165](https://github.com/paularmstrong/swig/pull/165)
|
|
5
|
+
* **Fixed** Allow variables in if tag conditionals to have filters with arguments [gh-167](https://github.com/paularmstrong/swig/pull/167)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
[0.13.5](https://github.com/paularmstrong/swig/tree/v0.13.5) / 2013-01-29
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** date filter output for 'O' when time-zone offset is negative [gh-185](https://github.com/paularmstrong/swig/pull/185)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.14.0](https://github.com/paularmstrong/swig/tree/v0.14.0) / 2013-06-08
|
|
2
|
+
-------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Allow executing functions from within templates [gh-182](https://github.com/paularmstrong/swig/pull/182)
|
|
5
|
+
* **Added** New `spaceless` tag [gh-193](https://github.com/paularmstrong/swig/pull/193)
|
|
6
|
+
* **Fixed** bug when attempting to loop over nested vars with `for`. [gh-232](https://github.com/paularmstrong/swig/pull/232)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[0.2.0](https://github.com/paularmstrong/swig/tree/v0.2.0) / 2011-09-11
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** `if` statements allow filters applied to operands.
|
|
5
|
+
* **Fixed** `for` loops allow filters applied to the object that will be iterated over.
|
|
6
|
+
|
|
7
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.0/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.2.1](https://github.com/paularmstrong/swig/tree/v0.2.1) / 2011-09-13
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Support for `else` within `if` blocks.
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.1/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.2.2](https://github.com/paularmstrong/swig/tree/v0.2.2) / 2011-09-16
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Support for `else if ...` within `if` blocks.
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.2/docs)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[0.2.3](https://github.com/paularmstrong/swig/tree/v0.2.3) / 2011-09-16
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Critical fix for negations in `if` blocks.
|
|
5
|
+
* **Added** Support for `forloop.first` in `for` blocks.
|
|
6
|
+
* **Added** Support for `forloop.last` in `for` blocks.
|
|
7
|
+
* **Added** Support for `forloop.key` in `for` blocks.
|
|
8
|
+
* **Added** Support for `{% empty %}` in `for` blocks.
|
|
9
|
+
|
|
10
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.3/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.3.0](https://github.com/paularmstrong/swig/tree/v0.3.0) / 2011-09-17
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Support for `{% set ... %}` tag.
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.3.0/docs)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[0.4.0](https://github.com/paularmstrong/swig/tree/v0.4.0) / 2011-09-24
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Macro support [docs](docs/tags.md)
|
|
5
|
+
* **Changed** Removed requirement to manually specify `locals` for express support.
|
|
6
|
+
* **Changed** Increased cache lookup speed by removing crypto dependency.
|
|
7
|
+
* **Fixed** `length` filter returns length of objects (number of keys).
|
|
8
|
+
* **Fixed** Filters return empty string unless they can apply to the given object.
|
|
9
|
+
* **Fixed** Filters will attempt to apply to all values in an object or array.
|
|
10
|
+
|
|
11
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.4.0/docs)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[0.5.0](https://github.com/paularmstrong/swig/tree/v0.5.0) / 2011-09-27
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** More error messaging in some edge cases.
|
|
5
|
+
* **Added** Better error messaging including context and line numbers.
|
|
6
|
+
* **Changed** Improved compile and render speeds.
|
|
7
|
+
* **Changed** `include` tags accept context variables instead of just strings.
|
|
8
|
+
* **Changed** Templates can be compiled and rendered from an absolute path outside of the template root.
|
|
9
|
+
* **Fixed** Will not double escape output.
|
|
10
|
+
|
|
11
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.5.0/docs)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[0.6.0](https://github.com/paularmstrong/swig/tree/v0.6.0) / 2011-10-02
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** `{% import foo as bar %}` tag for importing macros.
|
|
5
|
+
* **Added** Allow escaping for js in escape filter and autoescape tag.
|
|
6
|
+
* **Added** `raw` filter to force variable to not be escaped.
|
|
7
|
+
* **Added** `escape` and `e` filters to force variable to be escaped.
|
|
8
|
+
* **Added** Allow filters to accept any JS objects, arrays, strings, and context variables.
|
|
9
|
+
* **Changed** `if`, `else`, and `else if` tags support all JS-valid if-syntaxes + extra operators.
|
|
10
|
+
* **Fixed** `default` filter for undefined variables. closes gh-18
|
|
11
|
+
|
|
12
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.6.0/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.6.1](https://github.com/paularmstrong/swig/tree/v0.6.1) / 2011-10-02
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** chaining filters when the first takes a variable as an argument will not crash parsing.
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.6.1/docs)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[0.7.0](https://github.com/paularmstrong/swig/tree/v0.7.0) / 2011-10-05
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** `make browser` will build Swig for use in major browsers. [gh-3](https://github.com/paularmstrong/swig/issues/3)
|
|
5
|
+
* **Changed** Allow overriding `escape` filters. [gh-19](https://github.com/paularmstrong/swig/issues/19)
|
|
6
|
+
|
|
7
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.7.0/docs)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[0.8.0](https://github.com/paularmstrong/swig/tree/v0.8.0) / 2011-11-04
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** date filter formats `z`, `W`, `t`, `L`, `o`, `B`, and `c`.
|
|
5
|
+
* **Added** New `filter` tag.
|
|
6
|
+
* **Added** Node.js compatible 0.4.1 - 0.6.X
|
|
7
|
+
* **Added** Allow setting cache globally or per-template.
|
|
8
|
+
* **Changed** Removed `swig.render` and `swig.fromString`.
|
|
9
|
+
* **Changed** `swig.fromFile` is now `swig.compileFile`.
|
|
10
|
+
* **Changed** `swig.init()` will clear template cache.
|
|
11
|
+
* **Changed** `swig.init()` is now optional for browser mode with no custom settings.
|
|
12
|
+
* **Changed** Development dependencies are be more lenient.
|
|
13
|
+
* **Fixed** Parser will properly preserver '\' escaping. [gh-24](https://github.com/paularmstrong/swig/issues/24)
|
|
14
|
+
* **Fixed** Rewrote tag argument parsing for proper space handling.
|
|
15
|
+
* **Fixed** Rewrote filter argument parsing. [gh-23](https://github.com/paularmstrong/swig/issues/23)
|
|
16
|
+
* **Fixed** Allow pipe `|` characters in filter arguments. [gh-22](https://github.com/paularmstrong/swig/issues/22)
|
|
17
|
+
|
|
18
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.8.0/docs)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[0.9.0](https://github.com/paularmstrong/swig/tree/v0.9.0) / 2011-12-30
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** DateZ license to browser header, use link to underscore license.
|
|
5
|
+
* **Added** Timezone support in `date` filter [gh-27](https://github.com/paularmstrong/swig/issues/27).
|
|
6
|
+
* **Added** New `raw` tag.
|
|
7
|
+
* **Changed** Swig is no longer node 0.4 compatible.
|
|
8
|
+
* **Fixed** Filter `date('f')` for 10am times.
|
|
9
|
+
* **Fixed** Filter `date('r')` returns in UTC date format. This is more correct tospec RFC2822, per [php.net/date](http://php.net/date).
|
|
10
|
+
* **Fixed** Filter `add` when adding numbers/numbers+strings together.
|
|
11
|
+
* **Fixed** Tests for error messages that changed in node >0.6.0.
|
|
12
|
+
|
|
13
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.0/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.9.1](https://github.com/paularmstrong/swig/tree/v0.9.1) / 2012-01-18
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Allow multi-line tags and comments. [gh-30](https://github.com/paularmstrong/swig/issues/30)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.1/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.9.2](https://github.com/paularmstrong/swig/tree/v0.9.2) / 2012-01-23
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Correctly reset autoescape after closing an autoescape tag. [gh-39](https://github.com/paularmstrong/swig/issues/39)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.2/docs)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[0.9.3](https://github.com/paularmstrong/swig/tree/v0.9.3) / 2012-01-28
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Allow object and array values to be accessed via context variables [gh-40](https://github.com/paularmstrong/swig/issues/40)
|
|
5
|
+
|
|
6
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.3/docs)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[0.9.4](https://github.com/paularmstrong/swig/tree/v0.9.4) / 2012-02-07
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** `parent` tag would not render when called within tags [gh-41](https://github.com/paularmstrong/swig/issues/41)
|
|
5
|
+
* **Fixed** Documentation for forloop.index & forloop.key [gh-42](https://github.com/paularmstrong/swig/issues/42)
|
|
6
|
+
* **Fixed** Errors when using `include` inside base template `block` tags [gh-43](https://github.com/paularmstrong/swig/issues/43)
|
|
7
|
+
* **Fixed** Allow `set` tag to set values to numbers [gh-45](https://github.com/paularmstrong/swig/issues/45)
|
|
8
|
+
* **Fixed** `set` tag for booleans using too many checks
|
|
9
|
+
|
|
10
|
+
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.4/docs)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[1.0.0-pre1](https://github.com/paularmstrong/swig/tree/v1.0.0-pre1) / 2013-08-14
|
|
2
|
+
---------------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Completely rewritting parsing engine supports many more syntaxes and is much easier to extend.
|
|
5
|
+
* **Changed** There is no more `swig.init` method.
|
|
6
|
+
* **Changed** Custom filters can be added using `swig.addFilter`
|
|
7
|
+
* **Changed** Custom tags can be added using `swig.addTag`
|
|
8
|
+
* **Changed** Writing custom tags uses an entirely new, simplified format
|
|
9
|
+
* **Changed** Removed the underscore/lodash dependency
|
|
10
|
+
* **Changed** Template parsing has been completely rewritten
|
|
11
|
+
* **Changed** `swig.compileFile` returns a function that renders templates, not an object
|
|
12
|
+
* **Changed** Express-compatible using `swig.renderFile`.
|
|
13
|
+
* **Changed** `extends`, `import`, and `include` now reference files with relative paths from the current file ([info](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0#extends-include-import-changes)).
|
|
14
|
+
* **Changed** `extends` may no longer accept variables ([info](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0#extends-include-import-changes)).
|
|
15
|
+
* **Changed** `else if` tag is now `elseif` or `elif`.
|
|
16
|
+
* **Changed** Removed `only` argument from `include`.
|
|
17
|
+
* **Changed** allow `_`, `$` to start var names in templates.
|
|
18
|
+
* **Changed** Documentation is auto-generated from jsdoc comments in-files.
|
|
19
|
+
* **Added** Ability to set custom var/tag/comment controls (`{{`, `}}`, etc, can be customized).
|
|
20
|
+
* **Added** Variable/string concatenation [gh-135](https://github.com/paularmstrong/swig/issues/135).
|
|
21
|
+
* **Added** Binary application for `compile`, `run`, and `render` (Lets you pre-compile templates into JS functions for client-side delivery).
|
|
22
|
+
* **Fixed** Lots.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[1.0.0-pre2](https://github.com/paularmstrong/swig/tree/v1.0.0-pre2) / 2013-08-18
|
|
2
|
+
---------------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Binary: Allow --method-name to be a shortcut for --wrap-start var setting.
|
|
5
|
+
* **Changed** Make reverse filter an alias for `sort(true)`.
|
|
6
|
+
* **Added** Allow asyncronous `compileFile` and `renderFile` operations. [gh-283](https://github.com/paularmstrong/swig/issues/283)
|
|
7
|
+
* **Added** Filter: `sort`.
|
|
8
|
+
* **Added** Allow {% end[tag] tokens... %}. [gh-278](https://github.com/paularmstrong/swig/issues/278)
|
|
9
|
+
* **Added** Built source map for minified browser source.
|
|
10
|
+
* **Added** Contextual support for object method calls. [gh-275](https://github.com/paularmstrong/swig/issues/275)
|
|
11
|
+
* **Added** `parser.on('start'|'end'...` options. [gh-274](https://github.com/paularmstrong/swig/issues/274)
|
|
12
|
+
* **Added** Allow object prototypal inheritance. [gh-273](https://github.com/paularmstrong/swig/issues/273)
|
|
13
|
+
* **Fixed** Prevent circular extends. [gh-282](https://github.com/paularmstrong/swig/issues/282)
|
|
14
|
+
* **Fixed** Throw an error if reserved word is used as var. [gh-276](https://github.com/paularmstrong/swig/issues/276)
|
|
15
|
+
* **Fixed** Add filename to errors if possible. [gh-280](https://github.com/paularmstrong/swig/issues/280)
|
|
16
|
+
* **Fixed** Filters work over arrays/objects if possible. [gh-259](https://github.com/paularmstrong/swig/issues/259)
|
|
17
|
+
* **Fixed** Allow {% parent %} to work in middle parent templates. [gh-277](https://github.com/paularmstrong/swig/issues/277)
|
|
18
|
+
* **Fixed** Allow newlines in tags/vars/comments. [gh-272](https://github.com/paularmstrong/swig/issues/272)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[1.0.0-pre3](https://github.com/paularmstrong/swig/tree/v1.0.0-pre3) / 2013-08-20
|
|
2
|
+
---------------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Allow tags at block-level if specified. [gh-289](https://github.com/paularmstrong/swig/issues/289)
|
|
5
|
+
* **Fixed** `swig.compileFile` runs callback template is found in cache. [gh-291](https://github.com/paularmstrong/swig/issues/291)
|
|
6
|
+
* **Fixed** Accidental modification of Swig Options Object. [gh-287](https://github.com/paularmstrong/swig/issues/287)
|
|
7
|
+
* **Fixed** Preserve forward-slashes in text chunks. [gh-285](https://github.com/paularmstrong/swig/issues/285)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[1.0.0-rc1](https://github.com/paularmstrong/swig/tree/v1.0.0-rc1) / 2013-08-28
|
|
2
|
+
-------------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** `include` tag now accepts `only` (and is preferred, if possible). gh-240
|
|
5
|
+
* **Added** `swig.version` and `-v` to cli
|
|
6
|
+
* **Changed** Deprecated `raw` filter. Use `safe`.
|
|
7
|
+
* **Changed** Allow `import` and `macro` tags to be outside of blocks. gh-299
|
|
8
|
+
* **Changed** Don't escape `macro` output. gh-297
|
|
9
|
+
* **Changed** (Custom) Filters can be marked as `safe` to disable auto-escaping. gh-294
|
|
10
|
+
* **Fixed** `{% for k,v ... %}` tag syntax assigned variables backwards.
|
|
11
|
+
* **Fixed** Filters being applied to empty functions throwing errors. gh-296
|
|
12
|
+
* **Fixed** `include` paths on windows. gh-295
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[1.0.0-rc2](https://github.com/paularmstrong/swig/tree/v1.0.0-rc2) / 2013-09-06
|
|
2
|
+
-------------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Function output from `variable` blocks are no longer auto-escaped. gh-309
|
|
5
|
+
* **Fixed** Allow nested macros to work when importing. gh-310
|
|
6
|
+
* **Fixed** swig.setDefaultTZOffset. gh-311
|
|
7
|
+
* **Changed** `set` tag assigns to the local context, allowing setting within `for` loops, etc. gh-303
|
|
8
|
+
* **Fixed** Standardize variable undefined checking. gh-301
|
|
9
|
+
* **Fixed** Remove multiple redefinition of block-level tags in compiled templates.
|
|
10
|
+
* **Fixed** Performance issue with compile if no default locals are defined.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[1.0.0-rc3](https://github.com/paularmstrong/swig/tree/v1.0.0-rc3) / 2013-09-14
|
|
2
|
+
-------------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Allow bools in token parser by default. gh-321
|
|
5
|
+
* **Fixed** Allow variables as object values. gh-323
|
|
6
|
+
* **Fixed** Don't partially match logic words. gh-322
|
|
7
|
+
* **Fixed** Parent tag in parent's block with no local block edge case. gh-316
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[1.0.0](https://github.com/paularmstrong/swig/tree/v1.0.0) / 2013-09-23
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** Allow parent and other tags to work correctly nested in other tags. gh-331
|
|
5
|
+
* **Fixed** Prevent lexer from matching partial logic/words in variables. gh-330
|
|
6
|
+
|
|
7
|
+
Migrating from v0.x.x? View the [Migration Guide](https://github.com/paularmstrong/swig/wiki/Migrating-from-v0.x.x-to-v1.0.0)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[1.1.0](https://github.com/paularmstrong/swig/tree/v1.1.0) / 2013-10-02
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Allow logic in default parsing. gh-326
|
|
5
|
+
* **Fixed** Error when attempting to wrap spaceless tag around macro/function output. gh-336
|
|
6
|
+
* **Fixed** Don't overwrite keys on the locals object. gh-337
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[1.2.0](https://github.com/paularmstrong/swig/tree/v1.2.0) / 2013-12-01
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Filepath parameter can be passed to swig.run to allow extends in-browser. gh-349
|
|
5
|
+
* **Changed** Use local-context first for var lookups. gh-344, gh-347
|
|
6
|
+
* **Changed** Allow DOTKEY after functions/objects/filters. gh-355
|
|
7
|
+
* **Changed** Context of for-tags carries into includes. gh-356
|
|
8
|
+
* **Changed** When a callback is passed into compileFile, catch all errors thrown by compile and pass the error to callback. gh-340
|
|
9
|
+
* **Fixed** Instances of Swig retain their options properly. gh-351
|
|
10
|
+
* **Fixed** Fix misc documentation issues. gh-359, gh-358
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[1.3.0](https://github.com/paularmstrong/swig/tree/v1.3.0) / 2014-01-20
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Removed official node v0.8.x support
|
|
5
|
+
* **Added** Custom template loader support. gh-377, gh-384, gh-382
|
|
6
|
+
* **Added** Ability to set root path using template loaders. gh-382, gh-293
|
|
7
|
+
* **Added** CLI now accepts custom filter and tag arguments. gh-391
|
|
8
|
+
* **Added** Allow `set` tag to set keys on objects with bracket and dot-notation. gh-388
|
|
9
|
+
* **Added** `groupBy` filter from swig-extras. gh-383
|
|
10
|
+
* **Fixed** `swig.run` `filepath` arg is always optional. gh-402
|
|
11
|
+
* **Fixed** Filters on non-empty functions apply correctly. gh-397
|
|
12
|
+
* **Fixed** Filters applied to functions w/ & w/o dotkeys. gh-365
|
|
13
|
+
* **Fixed** `date` filter `N` option returns correct number. gh-375
|
|
14
|
+
* **Fixed** Ensure getting parent template checks cache if on. gh-378
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[1.3.2](https://github.com/paularmstrong/swig/tree/v1.3.2) / 2014-01-27
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** `for` loop variables on objects. gh-409
|
|
5
|
+
* **Fixed** Misc. IE8 fixes. gh-410
|
|
6
|
+
* **Fixed** `include` files when loaders have base paths. gh-407
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[1.4.0](https://github.com/paularmstrong/swig/tree/v1.4.0) / 2014-07-03
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Allow variable tokens to start with `$`. gh-455
|
|
5
|
+
* **Changed** `fs` loader should take `cwd` as default base path. gh-419
|
|
6
|
+
* **Changed** handle errors which occur at the time of rendering. gh-417
|
|
7
|
+
* **Changed** default options in bin (`varControls`, `tagControls`, `cmtControls`). gh-415
|
|
8
|
+
* **Changed** `null` should yield empty string when resolving variable. gh-408
|
|
9
|
+
* **Added** Escape character for `date` filter argument. gh-427, gh-432
|
|
10
|
+
* **Added** Make `if` and `elseif` throw a better error message when a tag body is omitted. gh-425
|
|
11
|
+
* **Fixed** don't throw errors on accessing property of `null` object. gh-471
|
|
12
|
+
* **Fixed** `loop` variables work correctly in nested loops. gh-433
|
|
13
|
+
* **Fixed** Some IE8 compatibility (require es5). gh-428
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
[1.4.1](https://github.com/paularmstrong/swig/tree/v1.4.1) / 2014-07-03
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Fixed** `macro` argument names colliding with context variable names. gh-457
|
|
5
|
+
* **Fixed** filter chaining within tags. gh-441
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[1.4.2](https://github.com/paularmstrong/swig/tree/v1.4.2) / 2014-08-04
|
|
2
|
+
-----------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Added** Report JS parse errors with template filenames. gh-492
|
|
5
|
+
* **Fixed** Ensure block-level tags (`set`, etc) are parsed in correct order. gh-495
|
|
6
|
+
* **Fixed** Ensure import tag uses current Swig instance's loader. gh-421, gh-503
|
|
7
|
+
* **Fixed** Allow disabling cache on compile/render functions directly. gh-423
|
|
8
|
+
* **Fixed** Ensure compilation does not leak global variables. gh-496
|
|
9
|
+
* **Fixed** Fix for-loops to run on strings. gh-478, gh-479
|
|
10
|
+
* **Fixed** Allow macro output to be assigned using `set` tag. gh-499, gh-502
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
[1.4.3](https://github.com/gina-io/swig/tree/v1.4.3) / 2026-04-09
|
|
2
|
+
-----------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Security** Pin `minimist` to `^1.2.8` via npm `overrides` to close CVE-2021-44906 (prototype pollution reachable through `swig` → `optimist@0.6.1` → `minimist@~0.0.1`). Requires npm >= 8.3 to honour the override. gh-swig-cve-2021-44906
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
[1.4.4](https://github.com/gina-io/swig/tree/v1.4.4) / 2026-04-10
|
|
2
|
+
-----------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
* **Changed** Replace uglify-js with terser in the Makefile build target -- make build now works on Node >= 14
|
|
5
|
+
|
|
6
|
+
* **Security** Block __proto__, constructor, and prototype access in template variables and set-tag assignments to prevent prototype-chain traversal and arbitrary code execution (CVE-2023-25345)
|
package/.changie.yaml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
changesDir: .changes
|
|
2
|
+
unreleasedDir: unreleased
|
|
3
|
+
changelogPath: HISTORY.md
|
|
4
|
+
versionExt: md
|
|
5
|
+
versionFormat: |-
|
|
6
|
+
{{- $h := printf "[%s](https://github.com/gina-io/swig/tree/v%s) / %s" .VersionNoPrefix .VersionNoPrefix (.Time.Format "2006-01-02") -}}
|
|
7
|
+
{{ $h }}
|
|
8
|
+
{{ repeat (len $h) "-" }}
|
|
9
|
+
kindFormat: ''
|
|
10
|
+
changeFormat: '* **{{.KindLabel}}** {{.Body}}{{with .Custom.Issue}} gh-{{.}}{{end}}'
|
|
11
|
+
kinds:
|
|
12
|
+
- label: Added
|
|
13
|
+
key: added
|
|
14
|
+
- label: Fixed
|
|
15
|
+
key: fixed
|
|
16
|
+
- label: Changed
|
|
17
|
+
key: changed
|
|
18
|
+
- label: Security
|
|
19
|
+
key: security
|
|
20
|
+
custom:
|
|
21
|
+
- key: Issue
|
|
22
|
+
type: string
|
|
23
|
+
newlines:
|
|
24
|
+
afterChangelogVersion: 1
|
|
25
|
+
endOfVersion: 1
|
|
26
|
+
beforeChange: 1
|