diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-liquid.min.js | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-liquid.min.js')
| -rw-r--r-- | public/prism/prism-liquid.min.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/public/prism/prism-liquid.min.js b/public/prism/prism-liquid.min.js new file mode 100644 index 0000000..d4089c2 --- /dev/null +++ b/public/prism/prism-liquid.min.js @@ -0,0 +1,45 @@ +(Prism.languages.liquid = { + comment: { + pattern: /(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/, + lookbehind: !0, + }, + delimiter: { + pattern: /^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/, + alias: 'punctuation', + }, + string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, + keyword: + /\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|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|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|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|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/, + function: [ + { pattern: /(\|\s*)\w+/, lookbehind: !0, alias: 'filter' }, + { pattern: /(\.\s*)(?:first|last|size)/, lookbehind: !0 }, + ], + boolean: /\b(?:false|nil|true)\b/, + range: { pattern: /\.\./, alias: 'operator' }, + number: /\b\d+(?:\.\d+)?\b/, + operator: /[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/, + punctuation: /[.,\[\]()]/, + empty: { pattern: /\bempty\b/, alias: 'keyword' }, +}), + Prism.hooks.add('before-tokenize', function (e) { + var i = !1; + Prism.languages['markup-templating'].buildPlaceholders( + e, + 'liquid', + /\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g, + function (e) { + var t = /^\{%-?\s*(\w+)/.exec(e); + if (t) { + var n = t[1]; + if ('raw' === n && !i) return (i = !0); + if ('endraw' === n) return !(i = !1); + } + return !i; + } + ); + }), + Prism.hooks.add('after-tokenize', function (e) { + Prism.languages['markup-templating'].tokenizePlaceholders(e, 'liquid'); + }); |
