mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 06:50:47 -07:00
1.7.1
This commit is contained in:
Vendored
+5
-5
@@ -1205,7 +1205,7 @@ function parse(html, filepath, options) {
|
|||||||
html = whiteSpaceCtrl(html, options);
|
html = whiteSpaceCtrl(html, options);
|
||||||
|
|
||||||
var tokens = [];
|
var tokens = [];
|
||||||
var syntax = /({%-?(.*?)-?%})|({{-?(.*?)-?}})/g;
|
var syntax = /({%-?(.*?)-?%})|({{(.*?)}})/g;
|
||||||
var result, htmlFragment, token;
|
var result, htmlFragment, token;
|
||||||
var lastMatchEnd = 0,
|
var lastMatchEnd = 0,
|
||||||
lastMatchBegin = -1,
|
lastMatchBegin = -1,
|
||||||
@@ -1275,13 +1275,13 @@ function parse(html, filepath, options) {
|
|||||||
function whiteSpaceCtrl(html, options) {
|
function whiteSpaceCtrl(html, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (options.trim_left) {
|
if (options.trim_left) {
|
||||||
html = html.replace(/{{-?/g, '{{-').replace(/{%-?/g, '{%-');
|
html = html.replace(/{%-?/g, '{%-');
|
||||||
}
|
}
|
||||||
if (options.trim_right) {
|
if (options.trim_right) {
|
||||||
html = html.replace(/-?}}/g, '-}}').replace(/-?%}/g, '-%}');
|
html = html.replace(/-?%}/g, '-%}');
|
||||||
}
|
}
|
||||||
var rLeft = options.greedy ? /\s+({[{%]-)/g : /\n[\t\r ]*({[{%]-)/g;
|
var rLeft = options.greedy ? /\s+({%-)/g : /[\t\r ]*({%-)/g;
|
||||||
var rRight = options.greedy ? /(-[}%]})\s+/g : /(-[}%]})[\t\r ]*\n/g;
|
var rRight = options.greedy ? /(-%})\s+/g : /(-%})[\t\r ]*\n?/g;
|
||||||
return html.replace(rLeft, '$1').replace(rRight, '$1');
|
return html.replace(rLeft, '$1').replace(rRight, '$1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "shopify-liquid",
|
"name": "shopify-liquid",
|
||||||
"version": "1.7.0",
|
"version": "1.7.1",
|
||||||
"description": "A feature-rich Liquid template engine for Node.js and browsers, with compliance with the Ruby version.",
|
"description": "A feature-rich Liquid template engine for Node.js and browsers, with compliance with the Ruby version.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user