diff --git a/src/Tokenizer.spec.ts b/src/Tokenizer.spec.ts
index f2d642c6..51381089 100644
--- a/src/Tokenizer.spec.ts
+++ b/src/Tokenizer.spec.ts
@@ -33,6 +33,9 @@ describe("Tokenizer", () => {
it("for self-closing title tag", () => {
expect(tokenize("
")).toMatchSnapshot();
});
+ it("for self-closing textarea tag", () => {
+ expect(tokenize("")).toMatchSnapshot();
+ });
});
describe("should support standard special tags", () => {
@@ -45,6 +48,28 @@ describe("Tokenizer", () => {
it("for normal sitle tag", () => {
expect(tokenize("")).toMatchSnapshot();
});
+ it("for normal textarea tag", () => {
+ expect(
+ tokenize(""),
+ ).toMatchSnapshot();
+ });
+ });
+
+ describe("should treat html inside special tags as text", () => {
+ it("for div inside script tag", () => {
+ expect(tokenize("")).toMatchSnapshot();
+ });
+ it("for div inside style tag", () => {
+ expect(tokenize("")).toMatchSnapshot();
+ });
+ it("for div inside title tag", () => {
+ expect(tokenize("")).toMatchSnapshot();
+ });
+ it("for div inside textarea tag", () => {
+ expect(
+ tokenize(""),
+ ).toMatchSnapshot();
+ });
});
describe("should correctly mark attributes", () => {
diff --git a/src/Tokenizer.ts b/src/Tokenizer.ts
index 423a8574..0ae7fca9 100644
--- a/src/Tokenizer.ts
+++ b/src/Tokenizer.ts
@@ -69,6 +69,7 @@ const enum State {
// Special tags
BeforeSpecialS, // Decide if we deal with `