pull/1965/head
Richard Harris 7 years ago
parent 0bdf4a4536
commit e682d5ca54

@ -36,8 +36,8 @@ const specials = new Map([
], ],
]); ]);
const SELF = /^svelte:self[\s\/>]/; const SELF = /^svelte:self(?=[\s\/>])/;
const COMPONENT = /^svelte:component[\s\/>]/; const COMPONENT = /^svelte:component(?=[\s\/>])/;
// based on http://developers.whatwg.org/syntax.html#syntax-tag-omission // based on http://developers.whatwg.org/syntax.html#syntax-tag-omission
const disallowedContents = new Map([ const disallowedContents = new Map([
@ -283,8 +283,6 @@ function readTagName(parser: Parser) {
const start = parser.index; const start = parser.index;
if (parser.read(SELF)) { if (parser.read(SELF)) {
parser.index -= 1;
// check we're inside a block, otherwise this // check we're inside a block, otherwise this
// will cause infinite recursion // will cause infinite recursion
let i = parser.stack.length; let i = parser.stack.length;
@ -308,10 +306,7 @@ function readTagName(parser: Parser) {
return 'svelte:self'; return 'svelte:self';
} }
if (parser.read(COMPONENT)) { if (parser.read(COMPONENT)) return 'svelte:component';
parser.index -= 1;
return 'svelte:component';
}
const name = parser.readUntil(/(\s|\/|>)/); const name = parser.readUntil(/(\s|\/|>)/);

Loading…
Cancel
Save