Skip to content

Commit 693b743

Browse files
authored
Liquid: Added all objects from Shopify reference (#2998)
1 parent fe3bc52 commit 693b743

File tree

5 files changed

+495
-17
lines changed

5 files changed

+495
-17
lines changed

components/prism-liquid.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Prism.languages.liquid = {
1212
greedy: true
1313
},
1414
'keyword': /\b(?:as|assign|break|continue|cycle|decrement|echo|else|elsif|(?:end)?(?:capture|case|comment|for|form|if|paginate|style|raw|tablerow|unless)|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,
15+
'object': /\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|comment|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|form|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|paginate|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|section|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tablerow|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/,
1516
'function': [
1617
{
1718
pattern: /(\|\s*)\w+/,

components/prism-liquid.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/languages/liquid/function_feature.test

+15-15
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
[
4747
["liquid", [
4848
["delimiter", "{{"],
49-
" product",
49+
["object", "product"],
5050
["punctuation", "."],
5151
"tags ",
5252
["operator", "|"],
@@ -56,7 +56,7 @@
5656
["liquid", [
5757
["delimiter", "{%"],
5858
["keyword", "if"],
59-
" product",
59+
["object", "product"],
6060
["punctuation", "."],
6161
"tags",
6262
["punctuation", "."],
@@ -67,7 +67,7 @@
6767
]],
6868
["liquid", [
6969
["delimiter", "{{"],
70-
" product",
70+
["object", "product"],
7171
["punctuation", "."],
7272
"tags ",
7373
["operator", "|"],
@@ -77,7 +77,7 @@
7777
["liquid", [
7878
["delimiter", "{%"],
7979
["keyword", "if"],
80-
" product",
80+
["object", "product"],
8181
["punctuation", "."],
8282
"tags",
8383
["punctuation", "."],
@@ -136,7 +136,7 @@
136136
["keyword", "assign"],
137137
" products ",
138138
["operator", "="],
139-
" collection",
139+
["object", "collection"],
140140
["punctuation", "."],
141141
"products ",
142142
["operator", "|"],
@@ -150,7 +150,7 @@
150150
["keyword", "assign"],
151151
" kitchen_products ",
152152
["operator", "="],
153-
" collection",
153+
["object", "collection"],
154154
["punctuation", "."],
155155
"products ",
156156
["operator", "|"],
@@ -224,7 +224,7 @@
224224
]],
225225
["liquid", [
226226
["delimiter", "{{"],
227-
" article",
227+
["object", "article"],
228228
["punctuation", "."],
229229
"published_at ",
230230
["operator", "|"],
@@ -253,7 +253,7 @@
253253
]],
254254
["liquid", [
255255
["delimiter", "{{"],
256-
" product",
256+
["object", "product"],
257257
["punctuation", "."],
258258
"price ",
259259
["operator", "|"],
@@ -264,7 +264,7 @@
264264
]],
265265
["liquid", [
266266
["delimiter", "{{"],
267-
" product",
267+
["object", "product"],
268268
["punctuation", "."],
269269
"price ",
270270
["operator", "|"],
@@ -276,7 +276,7 @@
276276

277277
["liquid", [
278278
["delimiter", "{{"],
279-
" product",
279+
["object", "product"],
280280
["punctuation", "."],
281281
"featured_media ",
282282
["operator", "|"],
@@ -289,7 +289,7 @@
289289
]],
290290
["liquid", [
291291
["delimiter", "{{"],
292-
" product",
292+
["object", "product"],
293293
["punctuation", "."],
294294
"featured_media ",
295295
["operator", "|"],
@@ -300,7 +300,7 @@
300300
]],
301301
["liquid", [
302302
["delimiter", "{{"],
303-
" product",
303+
["object", "product"],
304304
["punctuation", "."],
305305
"featured_media ",
306306
["operator", "|"],
@@ -402,11 +402,11 @@
402402

403403
["liquid", [
404404
["delimiter", "{{"],
405-
" article",
405+
["object", "article"],
406406
["punctuation", "."],
407407
"published_at ",
408408
["operator", "|"],
409-
["function", "date"],
409+
["object", "date"],
410410
["operator", ":"],
411411
["string", "\"%a, %b %d, %y\""],
412412
["delimiter", "}}"]
@@ -428,7 +428,7 @@
428428
]],
429429
["liquid", [
430430
["delimiter", "{{"],
431-
" product",
431+
["object", "product"],
432432
["punctuation", "."],
433433
"variants",
434434
["punctuation", "."],

0 commit comments

Comments
 (0)