Skip to content

Commit

Permalink
Liquid: Added all objects from Shopify reference (#2998)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaKXz authored Jul 15, 2021
1 parent fe3bc52 commit 693b743
Show file tree
Hide file tree
Showing 5 changed files with 495 additions and 17 deletions.
1 change: 1 addition & 0 deletions components/prism-liquid.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Prism.languages.liquid = {
greedy: true
},
'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/,
'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/,
'function': [
{
pattern: /(\|\s*)\w+/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-liquid.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions tests/languages/liquid/function_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
[
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"tags ",
["operator", "|"],
Expand All @@ -56,7 +56,7 @@
["liquid", [
["delimiter", "{%"],
["keyword", "if"],
" product",
["object", "product"],
["punctuation", "."],
"tags",
["punctuation", "."],
Expand All @@ -67,7 +67,7 @@
]],
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"tags ",
["operator", "|"],
Expand All @@ -77,7 +77,7 @@
["liquid", [
["delimiter", "{%"],
["keyword", "if"],
" product",
["object", "product"],
["punctuation", "."],
"tags",
["punctuation", "."],
Expand Down Expand Up @@ -136,7 +136,7 @@
["keyword", "assign"],
" products ",
["operator", "="],
" collection",
["object", "collection"],
["punctuation", "."],
"products ",
["operator", "|"],
Expand All @@ -150,7 +150,7 @@
["keyword", "assign"],
" kitchen_products ",
["operator", "="],
" collection",
["object", "collection"],
["punctuation", "."],
"products ",
["operator", "|"],
Expand Down Expand Up @@ -224,7 +224,7 @@
]],
["liquid", [
["delimiter", "{{"],
" article",
["object", "article"],
["punctuation", "."],
"published_at ",
["operator", "|"],
Expand Down Expand Up @@ -253,7 +253,7 @@
]],
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"price ",
["operator", "|"],
Expand All @@ -264,7 +264,7 @@
]],
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"price ",
["operator", "|"],
Expand All @@ -276,7 +276,7 @@

["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"featured_media ",
["operator", "|"],
Expand All @@ -289,7 +289,7 @@
]],
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"featured_media ",
["operator", "|"],
Expand All @@ -300,7 +300,7 @@
]],
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"featured_media ",
["operator", "|"],
Expand Down Expand Up @@ -402,11 +402,11 @@

["liquid", [
["delimiter", "{{"],
" article",
["object", "article"],
["punctuation", "."],
"published_at ",
["operator", "|"],
["function", "date"],
["object", "date"],
["operator", ":"],
["string", "\"%a, %b %d, %y\""],
["delimiter", "}}"]
Expand All @@ -428,7 +428,7 @@
]],
["liquid", [
["delimiter", "{{"],
" product",
["object", "product"],
["punctuation", "."],
"variants",
["punctuation", "."],
Expand Down
Loading

0 comments on commit 693b743

Please sign in to comment.