summaryrefslogtreecommitdiff
path: root/packages/astro-parser/src/parse/state/text.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro-parser/src/parse/state/text.ts')
-rw-r--r--packages/astro-parser/src/parse/state/text.ts32
1 files changed, 0 insertions, 32 deletions
diff --git a/packages/astro-parser/src/parse/state/text.ts b/packages/astro-parser/src/parse/state/text.ts
deleted file mode 100644
index 2bd87e37c..000000000
--- a/packages/astro-parser/src/parse/state/text.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// @ts-nocheck
-
-import { decode_character_references } from '../utils/html.js';
-import { Parser } from '../index.js';
-
-export default function text(parser: Parser) {
- const start = parser.index;
-
- let data = '';
-
- const shouldContinue = () => {
- // Special case 'code' content to avoid tripping up on user code
- if (parser.current().name === 'code') {
- return !parser.match('<') && !parser.match('{');
- }
- return !parser.match('<') && !parser.match('{') && !parser.match('`');
- };
-
- while (parser.index < parser.template.length && shouldContinue()) {
- data += parser.template[parser.index++];
- }
-
- const node = {
- start,
- end: parser.index,
- type: 'Text',
- raw: data,
- data: decode_character_references(data),
- };
-
- parser.current().children.push(node);
-}