Commit Graph
346 Commits
Author SHA1 Message Date
wǒ_is神仙 6e967f7f3a fix can't convert Fixnum into String 2013-02-06 12:55:35 +08:00
Dylan Smith 38b4543bf1 Use sets to check if methods are invokable without symbolizing. 2013-02-05 14:45:08 -05:00
Jason Roelofs 1300210f05 Convert Strainer to white-list method protection
After moving the method existence check from Context into Strainer,
updated Strainer to only accept invokation methods that were added via
filter Modules, and done in a way that respond_to? is never called,
preventing unconstrained Symbol table growth.
2013-01-16 11:14:01 -05:00
Jason Roelofs a48e162237 Change Drop method lookup to not hit respond_to?
Class.public_method_defined? ends up diving into Ruby's core looking for
a method with the given method_or_key. This process at some point turns
method_or_key into a Symbol. This change no longer takes that path and
thus doesn't grow the Symbol table.
2013-01-16 11:07:48 -05:00
Jason Roelofs 7bcb565668 Remove #to_sym calls from Drop and Variable
Symbols are not needed here and using plain strings is nicer on Ruby
2013-01-16 09:46:17 -05:00
Adam Tanner 0b36540b78 Liquid has UTF8 support. 2012-12-26 18:14:36 -08:00
Dylan Smith ee41b3f4a3 Fix filter parser regex for filter args without separating spaces.
The regex was using \S+ to match the comma between the filters
arguments, but would continue to match idependent quote characters and
filter separators. This can result in multiple filters being interpreted as
a single one with many arguments.
2012-12-18 01:23:31 -05:00
Marcus Stollsteimer b48ad7da3a Remove trailing whitespace 2012-11-18 10:29:22 +01:00
Marcus Stollsteimer afc3944a4a Fix assignment with no effect outside of iterator 2012-11-18 10:21:03 +01:00
Marcus Stollsteimer c79abf1f87 Avoid warnings for assigned but unused variable 2012-11-18 10:20:07 +01:00
Marcus Stollsteimer 90b40ffb4b Avoid warnings for shadowed outer local variable 2012-11-18 10:19:05 +01:00
Marcus Stollsteimer fea9c54768 Avoid warning for grouped expression 2012-11-18 10:08:00 +01:00
Tom Burns 6c2fde5eea Instantiate blank string once instead of at every comparison 2012-10-25 11:54:19 -04:00
Jon Daniel 9c183bea83 added interrupt class for continue/break statements
When a continue or break statement is executed it pushes an interrupt to a
stack in context. If any non-handled interrupts are present blocks will cease
to execute. The for loop can handle the most recent interrupt in the stack.
2012-08-21 13:14:27 -04:00
Jon Daniel 484fd18612 added break and continue tags 2012-08-21 00:00:02 -04:00
Dylan Smith f5a20ff8e8 Fix a regression in tablerow limit parameter.
I had accidentally read slice_collection_using_each as using to as an
inclusive limit rather than exclusive, and no tests covered the offset or
limit parameters.
2012-06-21 14:56:05 -04:00
Dylan Smith d0184555d9 Allow tablerow to work with any Enumerable. Closes #132 2012-06-20 11:07:11 -04:00
Jason Normore 515b31158e strip_html to ignore comments with html tags. fixes #1650 2012-06-11 10:32:12 -04:00
7ransandJason Normore 40cc799f3d Add example to split filter. 2012-06-11 10:32:12 -04:00
Daniel SchierbeckandJason Normore 5ac91e0837 Fix typo and add punctuation 2012-06-11 10:32:12 -04:00
Jonathan Rudenberg 1aff63ff57 Merge pull request #107 from amateurhuman/syntax-error-fixes-for-rubinius
Fix syntax error in htmltags.rb and for.rb for compatibility with rbx-2.0.0-dev (1.9.3)
2012-06-07 12:14:35 -07:00
Jonathan Rudenberg 08fdcbbf65 Merge pull request #120 from infospace/interpolate_regex_once
add interpolate once flag to regexes that never change
2012-06-07 12:06:57 -07:00
Michael Green 281e3ea9c8 add interpolate once flag to regexes that never change 2012-05-08 16:27:50 -07:00
Jeremy Friesen 740cd6e762 Merge branch 'master' of git://github.com/Shopify/liquid
* 'master' of git://github.com/Shopify/liquid:
  * Seperated 'Howto' into 'How to'. * Added periods to the second list as the first item has them. I guess I'm anally retentive like that. :)
  Fix conditions using negative number comparisons
2012-04-19 10:59:44 -04:00
Jeremy Friesen 5d0004a87e Added tests to verify that {{ 'now' | date :'%Y' }} and {{ 'today' | date :'%Y' }} work.
In the case of Ruby 1.9.3, 'now' is no longer parsed.  For safe
measures, I've added 'today' as well.
2012-04-19 10:48:55 -04:00
jamesallardice 12112dee35 Make strip_html filter strip contents of style tags 2012-04-11 16:23:21 +01:00
akira yamada 84ed3d9964 apply "o" option to regexps to improve process time 2012-04-02 19:31:55 +09:00
Dennis Theisen 0e3b522fe2 Fix conditions using negative number comparisons 2012-03-12 16:38:34 -04:00
Chris Kelly db07e2b67e Fix syntax error in for and htmltags files for compatibility with Rubinius 2.0.0-dev 2012-03-09 00:24:31 -08:00
Dennis Theisen b8d7b9aeda Fix for-tag update to also work properly in Ruby 1.8.
* Follow up commit to 3d7c1c8
2012-02-29 16:13:46 -05:00
Dennis Theisen 3d7c1c80a0 Ruby 1.8 compatibility fix: Ensure for-loop on an empty string does not enter for-body. 2012-02-29 14:41:21 -05:00
Dennis Theisen 043d816460 Fix tablerow block to work with collection names in quoted syntax.
* Allows e.g. {% tablerow product in collections['frontpage'] %} instead of only collections.frontpage
2012-02-22 12:45:38 -05:00
Jo Liss 4a2bbafeb4 Make strip_html strip tags spread across lines 2012-02-16 15:42:10 +01:00
Kristian PD 58ad90677b Clarified compatibility comments, removed unused var from tag test. 2012-01-20 17:22:23 -05:00
Kristian PD 2b04590d4b Revert "Revert "Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each).""
This reverts commit bce0033c65.
2012-01-20 16:54:26 -05:00
Kristian PD bce0033c65 Revert "Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each)."
This reverts commit 01dea94671.
2012-01-20 16:47:34 -05:00
Kristian PD 01dea94671 Added backwards compatibility for 1.8.7 String.each returning itself (and 1.9.3 not supporting .each).
Moved for tag tests to their own test model from StandardTagTest.
2012-01-20 16:45:41 -05:00
Tobias Lütke 1a1b4702d7 Merge pull request #80 from ROFISH/master
Add Filters to Assign
2011-12-20 13:58:05 -08:00
Igor Zubkov 0eafe7f2fd Fix typo 2011-12-16 12:28:29 +02:00
Jonathan Rudenberg c4d713b6bb Add modulo filter 2011-11-17 14:08:57 -05:00
Ryan Alyea 975b17b529 Allow filters in assign.
A simple attempt, but basically it shifts the parsing of the right hand side of the assign from a simple context lookup to using the Variable parser (that includes filters). Fixes #79.
2011-11-01 01:46:26 -07:00
Jonathan Rudenberg b816521563 Merge pull request #72 from zacstewart/patch-1
Correct formatting for doc comments
2011-10-15 17:25:48 -07:00
Jonathan Rudenberg 487b240404 Fix another drop call regression 2011-10-14 11:21:22 -04:00
Jonathan Rudenberg 8b5cf73ccc Fix regression with calling a drop with a empty string 2011-10-13 11:47:23 -04:00
Zac 6cf6d8b990 Correct formatting for doc comments
Portions of the code examples were not being rendered as code because they lacked a leading tab. Also, a missing period on the first sentence made the first paragraph confusing.
2011-09-10 10:36:22 -03:00
7rans cc7899aef5 Add split filter. 2011-08-31 21:28:32 -04:00
Jonathan Rudenberg 2434c3d0e0 Remove duplicate commas from StrictQuotedFragment. Closes #26. 2011-07-12 09:18:46 -04:00
Tobias Lütke 352f83a9d2 Merge pull request #28 from mcr/mcr_inc_tag
increment tag
2011-07-01 11:48:13 -07:00
Tobias Lütke 98c96ed86a Merge pull request #60 from a-team/master
Avoid creating singleton classes on nil, true and false objects
2011-07-01 11:43:27 -07:00
Tobias Lütke 410cce9740 Merge pull request #56 from oozou/for-else
For-else !!!
2011-07-01 11:42:17 -07:00