Skip to content

Commit

Permalink
Fixes #3584
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Dec 11, 2024
1 parent b5d53f4 commit 1dd828a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
8 changes: 1 addition & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"@11ty/recursive-copy": "^3.0.1",
"@sindresorhus/slugify": "^2.2.1",
"bcp-47-normalize": "^2.3.0",
"chardet": "^2.0.0",
"chokidar": "^3.6.0",
"cross-spawn": "^7.0.6",
"debug": "^4.3.7",
Expand Down
18 changes: 0 additions & 18 deletions src/TemplateContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import matter from "gray-matter";
import lodash from "@11ty/lodash-custom";
import { TemplatePath } from "@11ty/eleventy-utils";
import debugUtil from "debug";
import chardet from "chardet";

import EleventyExtensionMap from "./EleventyExtensionMap.js";
import TemplateData from "./Data/TemplateData.js";
Expand All @@ -18,7 +17,6 @@ import { withResolvers } from "./Util/PromiseUtil.js";

const { set: lodashSet } = lodash;
const debug = debugUtil("Eleventy:TemplateContent");
const debugDiagnostic = debugUtil("Eleventy:Diagnostics");
const debugDev = debugUtil("Dev:Eleventy:TemplateContent");

class TemplateContentConfigError extends EleventyBaseError {}
Expand Down Expand Up @@ -305,22 +303,6 @@ class TemplateContent {
if (!content && content !== "") {
let contentBuffer = fs.readFileSync(this.inputPath);

if (process.env.DEBUG) {
// Warning: this is slow!!
let encoding = chardet.detect(contentBuffer);

if (encoding.startsWith("UTF-16")) {
debug("Warning: %o encoding detected on %o.", encoding, this.inputPath);
debugDiagnostic(
"%o encoding detected on %o. Please re-save as UTF-8.",
encoding,
this.inputPath,
);
} else {
debug("%o encoding detected on %o.", encoding, this.inputPath);
}
}

content = contentBuffer.toString("utf8");

if (this.config.useTemplateCache) {
Expand Down

0 comments on commit 1dd828a

Please sign in to comment.