@11ty/client 4.0.0-alpha.5 → 4.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eleventy.core.js +225 -128
- package/dist/eleventy.js +3653 -3304
- package/dist/formats/eleventy-liquid.js +24 -16
- package/dist/formats/eleventy-markdown.js +8 -2
- package/dist/formats/eleventy-nunjucks.js +197 -277
- package/dist/plugins/eleventy-plugin-i18n.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.7 (@11ty/client/liquid Engine Bundle) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -4561,7 +4561,7 @@ var Tokenizer = class {
|
|
|
4561
4561
|
}
|
|
4562
4562
|
*readFileNameTemplate(options) {
|
|
4563
4563
|
const { outputDelimiterLeft } = options;
|
|
4564
|
-
const htmlStopStrings = [",", " ", outputDelimiterLeft];
|
|
4564
|
+
const htmlStopStrings = [",", " ", "\r", "\n", " ", outputDelimiterLeft];
|
|
4565
4565
|
const htmlStopStringSet = new Set(htmlStopStrings);
|
|
4566
4566
|
while (this.p < this.N && !htmlStopStringSet.has(this.peek())) {
|
|
4567
4567
|
yield this.match(outputDelimiterLeft) ? this.readOutputToken(options) : this.readHTMLToken(htmlStopStrings);
|
|
@@ -5111,24 +5111,28 @@ var Loader = class {
|
|
|
5111
5111
|
}
|
|
5112
5112
|
*candidates(file, dirs, currentFile, enforceRoot) {
|
|
5113
5113
|
const { fs: fs3, extname } = this.options;
|
|
5114
|
-
|
|
5115
|
-
|
|
5114
|
+
const isAllowed = /* @__PURE__ */ __name((filepath) => {
|
|
5115
|
+
if (!enforceRoot)
|
|
5116
|
+
return true;
|
|
5116
5117
|
for (const dir of dirs) {
|
|
5117
|
-
if (
|
|
5118
|
-
|
|
5119
|
-
break;
|
|
5120
|
-
}
|
|
5118
|
+
if (this.contains(dir, filepath))
|
|
5119
|
+
return true;
|
|
5121
5120
|
}
|
|
5121
|
+
return false;
|
|
5122
|
+
}, "isAllowed");
|
|
5123
|
+
if (this.shouldLoadRelative(file) && currentFile) {
|
|
5124
|
+
const referenced = fs3.resolve(this.dirname(currentFile), file, extname);
|
|
5125
|
+
if (isAllowed(referenced))
|
|
5126
|
+
yield referenced;
|
|
5122
5127
|
}
|
|
5123
5128
|
for (const dir of dirs) {
|
|
5124
5129
|
const referenced = fs3.resolve(dir, file, extname);
|
|
5125
|
-
if (
|
|
5130
|
+
if (isAllowed(referenced))
|
|
5126
5131
|
yield referenced;
|
|
5127
|
-
}
|
|
5128
5132
|
}
|
|
5129
5133
|
if (fs3.fallback !== void 0) {
|
|
5130
5134
|
const filepath = fs3.fallback(file);
|
|
5131
|
-
if (filepath !== void 0)
|
|
5135
|
+
if (filepath !== void 0 && isAllowed(filepath))
|
|
5132
5136
|
yield filepath;
|
|
5133
5137
|
}
|
|
5134
5138
|
}
|
|
@@ -7729,6 +7733,7 @@ var Liquid2 = class _Liquid extends TemplateEngine {
|
|
|
7729
7733
|
}
|
|
7730
7734
|
async compile(str, inputPath) {
|
|
7731
7735
|
let engine = this.liquidLib;
|
|
7736
|
+
let liquidOptions = this.liquidOptions;
|
|
7732
7737
|
let tmplReady = engine.parse(str, inputPath);
|
|
7733
7738
|
let options = {};
|
|
7734
7739
|
if (!inputPath || inputPath === "liquid" || inputPath === "md") {
|
|
@@ -7737,11 +7742,14 @@ var Liquid2 = class _Liquid extends TemplateEngine {
|
|
|
7737
7742
|
}
|
|
7738
7743
|
return async function(data) {
|
|
7739
7744
|
let tmpl = await tmplReady;
|
|
7740
|
-
options.globals =
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
+
options.globals = Object.assign(
|
|
7746
|
+
{
|
|
7747
|
+
page: data?.page,
|
|
7748
|
+
eleventy: data?.eleventy,
|
|
7749
|
+
collections: data?.collections
|
|
7750
|
+
},
|
|
7751
|
+
liquidOptions?.globals
|
|
7752
|
+
);
|
|
7745
7753
|
return engine.render(tmpl, data, options);
|
|
7746
7754
|
};
|
|
7747
7755
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.7 (@11ty/client/md Engine Bundle) */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
var __export = (target, all) => {
|
|
@@ -3643,7 +3643,13 @@ function linkify2(state, silent) {
|
|
|
3643
3643
|
if (!link2) return false;
|
|
3644
3644
|
let url = link2.url;
|
|
3645
3645
|
if (url.length <= proto.length) return false;
|
|
3646
|
-
|
|
3646
|
+
let urlEnd = url.length;
|
|
3647
|
+
while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) {
|
|
3648
|
+
urlEnd--;
|
|
3649
|
+
}
|
|
3650
|
+
if (urlEnd !== url.length) {
|
|
3651
|
+
url = url.slice(0, urlEnd);
|
|
3652
|
+
}
|
|
3647
3653
|
const fullUrl = state.md.normalizeLink(url);
|
|
3648
3654
|
if (!state.md.validateLink(fullUrl)) return false;
|
|
3649
3655
|
if (!silent) {
|