Dylan Thacker-Smith
bdb9a4a47f
Remove nil and empty string check in invoke_drop.
2015-11-09 15:03:36 -05:00
Tanel Jakobsoo
8d5a907dc8
Fixed issue where "nil" value for "escape" filter breaks rendering
...
Closes #664
2015-11-06 16:32:02 +02:00
Florian Weingarten
74cc41ce74
Merge pull request #662 from nickpearson/keep-argument-error-backtrace
...
Keep original stack trace in Liquid::ArgumentError
2015-10-29 15:24:54 +01:00
Nick Pearson
c582023321
Keep original stack trace in Liquid::ArgumentError
2015-10-29 08:15:37 -05:00
Thierry Joyal
ac041c4ad1
Rename before_method as liquid_method_missing
2015-10-28 17:28:19 +00:00
Justin Li
8612716129
Remove rescue in unescape filter
2015-10-21 02:01:21 -04:00
Larry Archer
04381418d3
Add url_decode filter to accompany url_encode
2015-10-21 01:58:22 -04:00
Marcel M. Cary
4100f8d641
Fix "sort" filter on empty array to return empty array
...
When sorting an empty array with the "sort" filter, it returns nil
instead of []. This confuses subsequent filters in the chain that
expect an array. For example, when followed by the "map" filter, it
produces an array containing one nil element: [nil].
I could special-case the nil return value, but that would be more
cumbersome than making sure "sort" always returns an array.
Add a case to the "sort" method to return [] if the array is empty,
before performing any checks on ary.first that assume a non-empty array.
There is still a danger of returning nil if the first item in the array
is nil and it is non-empty, but I'm not sure how better to handle that
case.
Apply a similar fix to sort_natural, uniq, and compact filters.
2015-09-29 10:24:31 -07:00
Dylan Thacker-Smith
704937bc00
Fix offenses from the new version of rubocop.
2015-09-25 19:34:44 -04:00
Justin Li
affae5ebef
Merge pull request #610 from boobooninja/gf3
...
Merge pull request 610
2015-08-03 20:50:14 -04:00
Akinori MUSHA
a215b70de9
Properly rescue ::ArgumentError in the date filter
2015-07-24 13:35:06 +09:00
Florian Weingarten
4d6dec9b5a
Fix chained access to multi-dimensional hash
2015-07-17 10:10:00 -04:00
Loren Hale
0b11b573d9
add global_filter
...
add a global filter using a proc
only add one proc and not an array
add tests to make sure the global_filter is applied after native filters
2015-07-12 16:46:43 +08:00
Justin Li
b4e133e26f
Fix regression in range lookup
2015-07-09 13:21:46 -04:00
Justin Li
1f9bd1d809
Add param to accept invalid input in to_integer
2015-07-09 13:18:06 -04:00
Dylan Thacker-Smith
14416b3c49
Move the syntax error rescue for adding error line numbers.
2015-07-09 11:25:05 -04:00
Dylan Thacker-Smith
c535af021a
Rename options instance variable in Variable and Tag.
2015-07-08 19:59:44 -04:00
Dylan Thacker-Smith
73834a7e52
Use reject rather than dup and delete.
2015-07-08 19:27:24 -04:00
Dylan Thacker-Smith
c45310170b
Use parse_context or options instead of @options.
2015-07-08 19:21:59 -04:00
Dylan Thacker-Smith
920e1df643
Rescue and re-raise syntax errors in Template#parse to add line numbers.
...
This can be done now that the parse context has the line number
information, so it doesn't need to be added on closer to the original
exception. This has the advantage of not having to rescue and re-raise the
exception multiple times, and simplifies liquid-c which would otherwise
have to rescue the exception in BlockBody#parse.
2015-07-08 19:21:59 -04:00
Dylan Thacker-Smith
cebf75b8d7
Implement line numbers without the Liquid::Token class.
2015-07-08 19:21:59 -04:00
Justin Li
83b6dd0268
Use to_integer for range lookup arguments
2015-07-08 17:37:07 -04:00
Justin Li
6fb402e60d
Move to_integer, to_date, and to_number to Liquid::Utils
2015-07-08 17:33:05 -04:00
Dylan Thacker-Smith
c4c398174b
Use early returns rather than large if in Variable#taint_check
2015-07-07 15:56:03 -04:00
Dylan Thacker-Smith
80b6ac3bc7
Add taint warnings to the context rather than the template.
2015-07-07 15:53:02 -04:00
Dylan Thacker-Smith
15974d9168
Merge pull request #612 from Shopify/fix-block-body-naming
...
Use node to refer to objects from the nodelist rather than token.
2015-07-07 15:49:58 -04:00
Dylan Thacker-Smith
fad3b8275c
Use node to refer to objects from the nodelist rather than token.
2015-07-04 20:57:35 -04:00
Dylan Thacker-Smith
5a071cb7f2
Remove standard exception rescue in escape filter.
2015-07-04 13:48:25 -04:00
Gaurav Chande
3c23cfc167
Add Liquid::Tag#tag_name
2015-07-02 20:18:09 +00:00
Justin Li
30ef7d14b0
Merge pull request #600 from carsonreinke/filter-compact
...
Merge pull request 600
2015-06-19 11:38:14 -04:00
David Cornu
ac180e8402
Use to_integer instead of to_i on arguments
2015-06-16 15:08:29 +00:00
Carson Reinke
5fbb312a67
"Trailing whitespace detected."
2015-06-15 14:27:48 -04:00
Carson Reinke
8385099960
Added "compact" filter
2015-06-15 14:14:28 -04:00
Florian Weingarten
1e23036b2d
Fix uniq filter with string input
2015-06-04 22:55:03 -04:00
Dylan Thacker-Smith
ad3748af21
Include template name with line numbers in render errors.
2015-06-04 13:44:01 -04:00
Florian Weingarten
5919626da4
Rename 'has_key?' and 'has_interrupt?'
2015-06-04 13:14:46 -04:00
Florian Weingarten
82269e2509
fix a few more rubocop offenses
2015-06-04 13:09:58 -04:00
Florian Weingarten
b347fac3c0
Merge pull request #592 from Shopify/method_literal
...
blank and empty as variable names
2015-06-04 19:09:48 +02:00
Florian Weingarten
e761a6864e
clean up some rubocop stuff
2015-06-04 12:56:29 -04:00
Florian Weingarten
4c22cef341
blank and empty as variable names
2015-06-04 12:30:50 -04:00
Florian Weingarten
6ace095207
Avoid parallel assignments
2015-06-04 11:56:47 -04:00
Gaurav Chande
6b0f6401d0
Merge pull request #590 from Shopify/allow-template-tags
...
Local Tags
2015-06-04 11:19:24 -04:00
Gaurav Chande
fc8e6c8d3a
Change Tokenizer test to fetch tokens instead of exposing ivar
2015-06-04 15:10:01 +00:00
Gaurav Chande
79d7dd06df
Extract tag fetching into a method (which can be overriden then)
2015-06-04 04:39:54 +00:00
Gaurav Chande
3a907a4db7
Move DEFAULT_OPTIONS related logic to Document
2015-06-04 04:39:54 +00:00
Gaurav Chande
8b98f92c7f
Extract tokenize logic from Template to a RubyTokenizer
2015-06-04 04:39:30 +00:00
Dylan Thacker-Smith
8a2947865b
Avoid an exception from checking if a string contains a non-string.
2015-06-03 02:21:51 -04:00
Dylan Thacker-Smith
ea29f8b4b8
Merge pull request #583 from Shopify/slice-nil-offset
...
Raise a Liquid::ArgumentError in slice filter for invalid integers.
2015-06-03 01:43:56 -04:00
Dylan Thacker-Smith
c84f4520cc
Keep input out of error message and add test for slice Integer parsing.
2015-06-03 01:35:01 -04:00
Dylan Thacker-Smith
3dd6433e2f
Merge pull request #584 from Shopify/replace-non-string
...
Convert arguments to replace filters to strings to avoid exceptions.
2015-06-02 16:41:15 -04:00