This commit is contained in:
harttle
2017-08-04 11:28:02 +08:00
parent e993118e87
commit 7904f823a8
3 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -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');
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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": {