Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #3425 import of Liquid.js #3426

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Engines/Liquid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import moo from "moo";
import liquidLib, { Tokenizer, evalToken } from "liquidjs";
import { Tokenizer, TokenKind, evalToken, Liquid as LiquidJs } from "liquidjs";
import { TemplatePath } from "@11ty/eleventy-utils";
// import debugUtil from "debug";

Expand Down Expand Up @@ -30,7 +30,7 @@ class Liquid extends TemplateEngine {

setLibrary(override) {
// warning, the include syntax supported here does not exactly match what Jekyll uses.
this.liquidLib = override || new liquidLib.Liquid(this.getLiquidOptions());
this.liquidLib = override || new LiquidJs(this.getLiquidOptions());
this.setEngineLib(this.liquidLib);

this.addFilters(this.config.liquidFilters);
Expand Down Expand Up @@ -274,11 +274,11 @@ class Liquid extends TemplateEngine {
}

parseForSymbols(str) {
let tokenizer = new liquidLib.Tokenizer(str);
let tokenizer = new Tokenizer(str);
/** @type {Array} */
let tokens = tokenizer.readTopLevelTokens();
let symbols = tokens
.filter((token) => token.kind === liquidLib.TokenKind.Output)
.filter((token) => token.kind === TokenKind.Output)
.map((token) => {
// manually remove filters 😅
return token.content.split("|").map((entry) => entry.trim())[0];
Expand Down