Commit Graph
55 Commits
Author SHA1 Message Date
Ashwin Maroli e4da4d49d2 assign regex to a constant 2018-03-13 23:36:56 +05:30
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
Dylan Thacker-Smith c535af021a Rename options instance variable in Variable and Tag. 2015-07-08 19:59:44 -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 cebf75b8d7 Implement line numbers without the Liquid::Token class. 2015-07-08 19:21:59 -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
Florian Weingarten 82269e2509 fix a few more rubocop offenses 2015-06-04 13:09:58 -04:00
Florian Weingarten 3372ca8136 Rubocop 2015-05-14 14:37:18 +00:00
Justin Li dd5ee81089 Disallow number and dash identifier prefixes 2014-10-29 12:08:00 -04:00
Justin Li 5616ddf00e Remove obsolete comment 2014-10-27 13:44:14 -04:00
Justin Li fcb23a4cd2 Disallow filters with no variable in strict mode 2014-10-27 13:34:27 -04:00
Justin Li 5d68e8803f Ensure nil works as a variable name 2014-10-21 14:03:10 -04:00
Justin Li dedd1d3dc0 Fix case where a variable name is falsy 2014-10-21 12:09:26 -04:00
Florian Weingarten 7196a2d58e Avoid parallel assignments 2014-10-18 13:58:32 +00:00
Dylan Thacker-Smith f387508666 Parse expressions in Liquid::Variable#parse. 2014-10-08 21:06:59 -04:00
Evan Huus e836024dd9 Check and handle when a tainted variable is used 2014-09-16 17:23:26 +00:00
Dylan Thacker-Smith b2a74883e9 Remove Liquid::FilterNotFoundError since it is never raised. 2014-09-15 17:42:07 -04:00
Florian Weingarten c83e1c7b6d prefix for Liquid::Error instances 2014-09-05 14:12:30 +00:00
Tristan HumeandFlorian Weingarten 3a0ee6ae91 Remove parser switching duplication 2014-09-05 14:12:29 +00:00
Florian Weingarten c2663258be Merge pull request #364 from collectiveidea/instrument-rendering-with-hooks
Profiling the rendering of a liquid template
2014-08-13 23:04:29 +02:00
Tristan Hume ffd4f9d959 Simplify secondary filter regex 2014-08-13 09:36:02 -04:00
Tristan Hume 292161865d Simplify filter parse regex 2014-08-13 09:28:01 -04:00
Jason Roelofs 173a58d36a Profile liquid rendering
Add a simple profiling system to liquid rendering. Each
liquid tag ({{ }} and {% %}) is processed through this profiling,
keeping track of the partial name (in the case of {% include %}), line
number, and the time it took to render the tag. In the case of {%
include %}, the profiler keeps track of the name of the partial and
properly links back tag rendering to the partial and line number for
easy lookup and dive down. With this, it's now possible to track down
exactly how long each tag takes to render.

These hooks get installed and uninstalled on an as-need basis so by
default there is no impact on the overall liquid execution speed.
2014-08-12 15:37:21 -04:00
Jason Hiltz-Laforge adb7d2bbb8 Reduce temporary objects during variable/filter parsing 2014-07-21 21:13:59 +00:00
Florian Weingarten 3dbb35d823 Merge branch 'freeze_all_the_things'
Conflicts:
	History.md
	lib/liquid/tags/assign.rb
	lib/liquid/tags/capture.rb
	lib/liquid/tags/decrement.rb
	lib/liquid/tags/if.rb
2014-03-24 12:39:34 -04:00
Dylan Thacker-Smith 3b14e27f55 Allow newlines in tags and variables. 2014-03-20 17:27:03 -04:00
Dylan Thacker-Smith 503d924274 Use start and end of string rather than line matching in regexes. 2014-03-13 17:56:42 -04:00
Florian Weingarten 43ac8d560b Freeze all the things 2014-01-07 12:35:16 -05:00
Tristan Hume dd3196b22e Consistency in warnings. 2013-08-22 16:15:12 -04:00
Tristan Hume 5bdfb62bf2 Remove old warning method 2013-08-22 12:57:16 -04:00
Tristan Hume b0cba5298a Fix warnings and make tags a proper syntax tree. 2013-08-22 12:44:23 -04:00
Tristan Hume 0beb4a4793 Add handy context to strict parser error messages. 2013-08-19 15:45:05 -04:00
Tristan Hume 84f0c1bef8 Initial options passing 2013-07-30 14:44:41 -04:00
Tristan Hume d5d41a8202 Make previous commit work 2013-07-29 12:43:05 -04:00
Tristan Hume c8bd0b91b3 Catch easy cases 2013-07-29 12:07:18 -04:00
Tristan Hume 87b8ee7341 Add error mode switching 2013-07-26 11:45:13 -04:00
Tristan Hume 4da7b36139 New variable parser! 2013-07-25 11:38:57 -04:00
Dylan Thacker-Smith 23203c0122 Fix some old templates that abused colon as an argument separator.
This is a fallback for keyword argument parsing since this feature broke
old templates that accidentally used a colon as a filter argument
separator.
2013-05-21 17:47:46 -04:00
Tom Burns 8913a5615a Revert "Merge pull request #185 from ISSIntel/liquid-utf8"
This reverts commit c5dfcd29b0, reversing
changes made to f7d1e1d0c1.
2013-05-20 19:53:13 -04:00
Ozéias Sant'ana f9c289372d Merge branch 'master' into liquid-utf8
Conflicts:
	lib/liquid/variable.rb
2013-04-23 13:10:16 -03:00
Dylan Smith 9913895b81 Merge branch 'master' into remove-symbolizing
Conflicts:
	lib/liquid/variable.rb
2013-03-05 15:25:11 -05:00
Dylan Smith d706db3bd7 Add support for filter keyword arguments. Closes #175 2013-03-05 15:17:14 -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
Michael Green 281e3ea9c8 add interpolate once flag to regexes that never change 2012-05-08 16:27:50 -07:00
Steven Soroka 1a4ff9547a render_all should internally always return strings. This eases some 1.9 compatability issues. 2011-05-02 10:58:27 -04:00
James MacAulay cbf8986745 fix variable output with quoted strings containing pipe ("|") characters 2009-09-23 15:54:25 -04:00
Jakub KuźmaandTobias Lütke daadb1a2d6 Ruby 1.9.1 bugfixes
Signed-off-by: Tobias Lütke <[email protected]>
2009-04-17 06:33:20 +08:00