Ashwin Maroli
bfa2df7036
Stash exception_renderer lambda in a constant
2020-10-26 19:44:00 +05:30
Ashwin Maroli
0e52706a5b
Remove redundant comment in Liquid::Template ( #1328 )
2020-10-22 12:49:02 -04:00
Justin Li
8e99b3bd7f
Merge pull request #1322 from ashmaroli/else-tag-names
...
Stash array of tag names in a constant
2020-10-21 12:09:14 -04:00
Dylan Thacker-Smith
001fde7694
Avoid allocating arrays of key value pairs for hashes in assign_score_of
2020-10-21 10:36:00 -04:00
Ashwin Maroli
b15428ea83
Stash array of tag names in a constant
2020-10-21 18:50:56 +05:30
Dylan Thacker-Smith
c9ad9d338c
Extract method for raising a syntax error in the assign tag for liquid-c ( #1321 )
2020-10-20 16:59:52 -04:00
Dylan Thacker-Smith
ae6bd9f6b0
Allow an empty variable tag during strict parsing for liquid-c compat ( #1320 )
2020-10-20 14:11:48 -04:00
Dylan Thacker-Smith
46fd63da5f
Fix strict parsing of find variable with a name expression
2020-10-19 12:17:25 -04:00
Dylan Thacker-Smith
420a1c79e1
Refactor variable lookup strict parsing to reduce coupling on dot lookup
2020-10-19 12:10:32 -04:00
Dylan Thacker-Smith
6d39050e1e
Use a case statement in Liquid::Parser#expression
2020-10-19 12:10:11 -04:00
Dylan Thacker-Smith
d250a7f502
Set Context#initialize instance variables before squashing assigns ( #1307 )
2020-10-06 21:00:08 -04:00
Peter Zhu
7aed2f122c
Refactor raising tag never closed to method
2020-10-06 15:55:55 -04:00
Peter Zhu
5199a34d9b
Merge pull request #1304 from Shopify/pz-raw-bug
...
Fix duplication of text in raw tags
2020-10-05 10:59:15 -04:00
Peter Zhu
4c2ab6f878
Fix bug in raw tags
2020-10-05 10:47:28 -04:00
Dylan Thacker-Smith
33760f083a
Extract rescue code from BlockBody#render_node for re-use in liquid-c
2020-09-25 11:24:39 -04:00
Dylan Thacker-Smith
a03f02789b
Only use MethodLiteral in condition expressions ( #1300 )
2020-09-25 11:10:33 -04:00
Dylan Thacker-Smith
ca4b9b43af
Port liquid-c bug compatible whitespace trimming ( #1291 )
2020-09-16 16:07:36 -04:00
Dylan Thacker-Smith
77084930e9
Bring back silencing of errors in blank nodes for backwards compatibility ( #1292 )
2020-09-15 10:35:18 -04:00
Dylan Thacker-Smith
0d02dea20b
Rename Liquid::Block#unknown_tag parameters for clarity
2020-09-11 09:33:12 -04:00
Dylan Thacker-Smith
86b47ba28b
Pass the tag markup and tokenizer to Document#unknown_tag
...
The parse_context no longer needs to be passed in because it is available
through through an attr_reader on the instance. However, the markup and
tokenizer weren't made available. This refactor also makes the parameters
given to Document#unknown_tag consistent with Block#unknown_tag.
2020-09-11 09:33:12 -04:00
Dylan Thacker-Smith
bbc56f35ec
Add ParseContext#new_block_body to centralize the liquid-c override point
2020-09-09 12:25:35 -04:00
Dylan Thacker-Smith
dfbbf87ba9
Use BlockBody from Document using composition rather than inheritence
...
This way liquid-c can more cleanly use a Liquid::C::BlockBody object
for the block body by overriding Liquid::Document#new_body.
2020-09-08 14:00:52 -04:00
Dylan Thacker-Smith
037b603603
Turn some Liquid::BlockBody methods into class methods for liquid-c
...
So they can be used from a Liquid::C::BlockBody
2020-09-08 14:00:48 -04:00
Dylan Thacker-Smith
bd33df09de
Provide Block#new_body so that liquid-c can override it
...
This way liquid-c can return a body of a different class that wraps
a C implementation.
2020-09-08 13:59:48 -04:00
Dylan Thacker-Smith
e1a2057a1b
Update assign_score during capturing
...
To stop long captures before they grow the heap more then they should.
2020-09-03 11:13:08 -04:00
Dylan Thacker-Smith
ae9dbe0ca7
Fix render length resource limit so it doesn't multiply nested output
2020-09-03 11:13:04 -04:00
Dylan Thacker-Smith
3b486425b0
Handle BlockBody#blank? at parse time ( #1287 )
2020-09-03 11:07:13 -04:00
Dylan Thacker-Smith
b08bcf00ac
Push interrupts from Continue and Break tags rather than from BlockBody ( #1286 )
2020-09-03 06:55:24 -04:00
Dylan Thacker-Smith
0740e8b431
Remove unused quirk allowing liquid tags to close a block it is nested in ( #1284 )
2020-09-03 06:51:56 -04:00
Dylan Thacker-Smith
5532df880f
Handle disabled tags errors like other liquid errors ( #1275 )
2020-08-18 11:39:54 -04:00
Dylan Thacker-Smith
2b11efc3ae
Fix performance regression from introduction of Template#disable_tags ( #1274 )
2020-08-18 11:25:51 -04:00
Dylan Thacker-Smith
065ccbc4aa
Remove support for taint checking
2020-07-23 16:22:46 -04:00
Feken Baboyan
8541c6be35
make Template override static registers only when the register key is not defined
2020-05-28 09:08:03 -04:00
Thierry Joyal
f5011365f1
[StaticRegisters] Remove registers attr_reader
2020-05-22 10:51:07 -04:00
Thierry Joyal
b9979088ec
[StaticRegisters] Fetch raise on missing
...
Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com >
2020-05-22 09:35:47 -04:00
Dylan Thacker-Smith
e9b649b345
Fix Liquid::Template inheritance ( #1227 )
...
self.class.default_resource_limits would return `nil` in a subclass, since
the attribute isn't set on subclasses.
2020-01-21 15:09:22 -05:00
Celso Dantas
c08a358a2b
Use String literal instead of using a class method
...
The class method string definition is not needed here, so it can be removed.
2020-01-16 09:42:32 -05:00
Dylan Thacker-Smith
48a155a213
Initialize Liquid::Template class attributes eagerly instead of lazily ( #1223 )
2020-01-10 17:42:01 -05:00
Dylan Thacker-Smith
ef79fa3898
style: Avoid deep nesting for parsing the liquid tag in the block body
2020-01-09 19:13:13 -05:00
Dylan Thacker-Smith
f7ad602bfc
Fix liquid tag nested in outer block
2020-01-09 19:13:13 -05:00
Dylan Thacker-Smith
67eca3f58d
Upgrade rubocop and style guide for ruby 2.7 compatibility
2020-01-09 13:15:34 -05:00
Thierry Joyal
0847bf560f
Merge pull request #1218 from Shopify/strainer/remove-safe-navigation
...
Remove handling of a nil context in the Strainer class
2020-01-07 11:54:49 -05:00
Dylan Thacker-Smith
8074565c3e
Merge pull request #1216 from Shopify/unsupported-taint-mode
...
Remove support for taint_mode on ruby versions that don't support it
2020-01-07 10:12:36 -05:00
Thierry Joyal
c0ffee3ff9
[Strainer] Remove safe navigation
2020-01-06 18:34:13 +00:00
Thierry Joyal
c0ffeeef26
[Strainer] Separate factory from template
2020-01-06 17:45:25 +00:00
Dylan Thacker-Smith
40c68c9c83
Remove support for taint_mode on ruby versions that don't support it
2019-12-19 11:12:51 -05:00
Martin Morissette
d8f31046a9
Introduce template factory
2019-12-17 21:45:08 -05:00
Mike Angell
57c9cf64eb
Allow render to handle with and for correctly ( #1193 )
...
* Allow render to handle with and for correctly
* code improvements
2019-10-23 04:12:46 +10:00
Alessandro Diogo Brückheimer
e83b1e4159
Add ForceEqualSignAlignment to .rubocop.yml ( #1190 )
...
* Add ForceEqualSignAlignment to .rubocop.yml
* Revert ForceEqualSignAlignment cop
* Update method alignment
* Undo addition of whitespace to improve readability
* Fix missing alignment
2019-10-21 21:18:48 +10:00
Mike Angell
3784020a8d
[New Feature] Add forloop inside render tag when using for syntax ( #1191 )
...
* Add forloop to render for syntax
* Remove forloop guard
2019-10-17 23:06:13 +10:00