intial
This commit is contained in:
23
node_modules/svelte/src/compiler/phases/1-parse/state/text.js
generated
vendored
Normal file
23
node_modules/svelte/src/compiler/phases/1-parse/state/text.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/** @import { AST } from '#compiler' */
|
||||
/** @import { Parser } from '../index.js' */
|
||||
import { decode_character_references } from '../utils/html.js';
|
||||
|
||||
/** @param {Parser} parser */
|
||||
export default function text(parser) {
|
||||
const start = parser.index;
|
||||
|
||||
while (parser.index < parser.template.length && !parser.match('<') && !parser.match('{')) {
|
||||
parser.index++;
|
||||
}
|
||||
|
||||
const data = parser.template.slice(start, parser.index);
|
||||
|
||||
/** @type {AST.Text} */
|
||||
parser.append({
|
||||
type: 'Text',
|
||||
start,
|
||||
end: parser.index,
|
||||
raw: data,
|
||||
data: decode_character_references(data, false)
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user