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