Skip to content

Commit

Permalink
Add a short comment failure example
Browse files Browse the repository at this point in the history
  • Loading branch information
openandclose committed Oct 12, 2019
1 parent 19d4b18 commit 0370865
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,14 @@ describe.skip("A file with a BOM and a <meta charset> of x-user-defined", () =>
assert.strictEqual(sniffedEncoding, "windows-1252");
});
});


describe("A file with short comment and a <meta charset>", () => {
const buffer = read("zzz-short-comment.html");

it("should sniff as the charset value, given no options", () => {
const sniffedEncoding = htmlEncodingSniffer(buffer);

assert.strictEqual(sniffedEncoding, "ISO-8859-2");
});
});
7 changes: 7 additions & 0 deletions test/zzz-short-comment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<!--><meta charset="iso-8859-2">
</head>
<body></body>
</html>

0 comments on commit 0370865

Please sign in to comment.