mirror of https://github.com/sveltejs/svelte
21 lines
445 B
21 lines
445 B
import { decodeCharacterReferences } from '../utils/html.js';
|
|
|
|
export default function text ( parser ) {
|
|
const start = parser.index;
|
|
|
|
let data = '';
|
|
|
|
while ( parser.index < parser.template.length && !parser.match( '<' ) && !parser.match( '{{' ) ) {
|
|
data += parser.template[ parser.index++ ];
|
|
}
|
|
|
|
parser.current().children.push({
|
|
start,
|
|
end: parser.index,
|
|
type: 'Text',
|
|
data: decodeCharacterReferences( data )
|
|
});
|
|
|
|
return null;
|
|
}
|