Mike Angell
d1deb89085
Remove support for fallback proc on last scope
...
This was introduced but never actually used. The introduction of environments.last as the fallback for unfound variables means this functionality is already broken
2019-08-29 11:40:08 +10:00
Mike Angell
8f68cffdf1
Resolve failing rubocop issues
2019-08-29 00:45:38 +10:00
Tobias Lütke
6eab595fae
Merge pull request #1086 from Shopify/liquid-tag
...
Add {% liquid %} and {% echo %} tags
2019-08-27 15:10:20 -04:00
Florian Weingarten
248c54a386
Merge pull request #1091 from Shopify/rendering-with-less-garbage
...
Rendering with less garbage
2019-07-19 15:53:22 +01:00
Florian Weingarten
9640e77805
render_to_output_buffer
2019-04-23 17:06:29 -04:00
David Cornu
70ed1fc86d
Make sure the limit and offset values are integers
2019-04-23 16:44:37 -04:00
Florian Weingarten
2a1ca3152d
liquid without the garbage
2019-04-22 16:34:31 -04:00
Florian Weingarten
c89ce9c2ed
use bytesize, not length
2019-04-17 18:55:13 +01:00
Justin Li
e6ed804ca5
Fix line number tracking after a non-empty blank token
2019-04-08 18:43:09 -04:00
Justin Li
951abb67ee
Remove {% local %} tag
2019-04-08 18:34:39 -04:00
Justin Li
8d1cd41453
Add {% liquid %}, {% echo %}, and {% local %} tags
2019-04-01 20:08:38 -04:00
Justin Li
39fecd06db
Fix interrupts through includes
2019-03-12 12:18:22 -04:00
Clayton Smith
e2d9907df2
Validate the character encoding in url_decode.
2019-03-07 14:01:10 -05:00
Justin Li
23d669f5e6
Merge pull request #1032 from printercu/patch-1
...
Single regexp for strip_html
2019-02-22 13:04:04 -05:00
Justin Li
ed73794f82
Preserve existing strip_html behaviour for weird inputs
2019-02-22 13:00:36 -05:00
Ashwin Maroli
f59f6dea83
Fix simple RuboCop offenses and update TODO file ( #1062 )
...
* Fix Layout/EmptyLineAfterMagicComment offense
* Fix Layout/ExtraSpacing offense
* Fix Layout/ClosingParenthesisIndentation offenses
* Fix Style/MutableConstant offense
* Fix Style/UnneededInterpolation offenses
* Fix Style/RedundantParentheses offenses
* Update TODO config for RuboCop
* Add executable bit to test/test_helper.rb
ref: https://travis-ci.org/Shopify/liquid/jobs/488169512#L578
2019-02-22 12:32:56 -05:00
Garland Zhang
cec27ea326
Extract raise error line and some filters with begin/rescue blocks
2019-02-21 17:00:20 -05:00
Stephen Paul Weber (Work)
fe4034ccf9
Merge pull request #1025 from Shopify/traverse-ast
...
Liquid::ParseTreeVisitor
2018-10-18 09:42:56 -04:00
Stephen Paul Weber
8217a8d86c
Add test for the full array structure
2018-10-18 09:39:05 -04:00
Stephen Paul Weber
7d13d88258
s/Traversal/ParseTreeVisitor
2018-10-18 09:38:33 -04:00
Stephen Paul Weber
c11fc656cf
Colocate Traversal classes with classes they traverse
...
This puts all knowledge of the traversal in the same file, and removes
the need for a CASES registry.
2018-10-18 09:37:48 -04:00
Stephen Paul Weber
d789ec4175
Liquid::Traversal
...
This enables traversal over whole document tree.
2018-10-15 10:11:58 -04:00
Samuel Doiron
fd09f049b0
Merge pull request #1026 from Shopify/where-filter
...
Add `where` filter to standard filters
2018-10-11 17:45:30 -04:00
Samuel
842986a972
Add where filter to standard filters
...
Users of Liquid will often wish to filter an array to only those items that match a certain criteria. For example, showing "pinned" messages at the top of a list.
Example usage:
`{{ comments | where: "pinned" | first }}`
or
`{{ products | where: "category", "kitchen" }}`
* Add where filter to standard filters
* Add tests for new where functionality
2018-10-11 16:52:32 -04:00
Justin Li
cd5a6dd225
Merge pull request #930 from er1/fix-sort-natural-on-nil
...
Fix sort and sort_natural on sorting with non-string and nil values
2018-10-04 22:32:37 -04:00
Dylan Thacker-Smith
4369fe6c85
Improve the unexpected end delimiter message for block tags. ( #1003 )
2018-04-05 11:18:13 -04:00
Dylan Thacker-Smith
5106466a2d
Add a regression test for a liquid-c trim mode bug ( #972 )
2018-01-25 10:55:01 -05:00
Thibaut Courouble
147d7ae24d
Rename min/max filters for clarity
2017-12-06 09:48:30 -05:00
Thibaut Courouble
282d42f98d
Fix min/max filters
2017-12-06 08:58:05 -05:00
Justin Li
e6ba6ee87b
Revert "Use replacement string for replace filters literally ( #924 )"
...
This reverts commit 27c91203ab .
2017-12-04 15:07:59 -05:00
Nithin Bekal
4bdaaf069f
Add max/min filters
2017-11-30 13:56:37 -05:00
Justin Li
a7c5e247c8
Bump rubocop
2017-11-22 11:59:06 -05:00
Eric Chan
deb10ebc7a
Sorting support for data with undefined values
2017-09-14 02:00:43 -04:00
Eric Chan
cfe1844de9
Added test coverage for sort_natural
2017-09-13 22:17:59 -04:00
Dylan Thacker-Smith
27c91203ab
Use replacement string for replace filters literally ( #924 )
2017-08-28 11:51:20 -04:00
Justin Li
44eaa4b9d8
Merge pull request #920 from Shopify/symbol_to_liquid
...
Support rendering symbols as strings
2017-08-18 12:10:53 -04:00
Pascal Betz
a979b3ec95
Do not raise when variable is defined but nil when using strict_variables
2017-08-18 12:09:57 -04:00
Justin Li
bf3e759da3
Support rendering symbols as strings
2017-08-17 23:10:57 -04:00
Thierry Joyal
e340803d12
CGI powered standard filters to handle non string inputs
2017-05-25 15:53:41 +00:00
Dylan Thacker-Smith
3bb29d5456
Replace assert_equal nil, with a assert_nil ( #895 )
2017-05-11 14:05:03 -04:00
Dylan Thacker-Smith
9c72ccb82f
Limit how much blocks can be nested during parsing ( #894 )
2017-05-11 09:37:53 -04:00
Mike Angell
c9bac9befe
Merge branch 'master' into contains-strict-fix
2017-03-24 11:09:09 +10:00
Lasse Skindstad Ebert
5149cde5c3
Fix include tag used with strict_variables ( #829 )
...
Fixes https://github.com/Shopify/liquid/issues/828
2017-03-22 16:00:31 -04:00
Richard Monette
d17f86ba4d
handle join on fixnum
2017-02-01 12:47:35 -05:00
Dylan Thacker-Smith
869dbc7ebf
feature: Allow a default exception renderer to be specified ( #837 )
...
This could be used to preserve the old default of rendering
non-Liquid::Error messages or for providing default behaviour like error
reporting which could be missed if the exception renderer needed to be
specified on each render.
2016-12-12 10:29:09 -05:00
Dylan Thacker-Smith
f27bd619b9
change: Render an opaque internal error by default for non-Liquid::Error ( #835 )
...
These errors may contain sensitive information, so is safer to
render a more vague message by default.
This is done by replacing non-Liquid::Error exceptions with a
Liquid::InternalError exception with the non-Liquid::Error accessible on
through the cause method. This also allows the template name and line
number to be attached to the template errors.
The exception_handler render option has been changed to exception_renderer
since now it should raise an exception to re-raise on a liquid rendering
error or return a string to be rendered where the error occurred.
2016-12-07 17:34:29 -05:00
Richard Monette
b2feeacbce
Merge pull request #812 from Shopify/allow-split-to-accept-numeric
...
allow split to accept numeric
2016-10-26 10:59:44 -04:00
Richard Monette
143ba39a08
allow split to accept numeric
2016-10-26 10:43:04 -04:00
Richard Monette
bb3624b799
dont explode when sorting nil property
2016-10-04 13:22:29 -04:00
Konstantin Tennhard
64fca66ef5
Merge pull request #797 from Shopify/truncatewords-resiliency
...
Standard filter truncate / truncatewords: force truncate_string to string
2016-09-13 10:43:55 -04:00