0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Merge pull request #394 from sveltejs/fix-overly-aggressive-reserved-tag-parsing

Only do special reserved name handling when tag is all lowercase letters
This commit is contained in:
Rich Harris 2017-03-19 08:46:27 -04:00 committed by GitHub
commit 399c7e092d
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ export default function readExpression ( parser ) {
const start = parser.index;
const name = parser.readUntil( /\s*}}/ );
if ( name && /^\w+$/.test( name ) ) {
if ( name && /^[a-z]+$/.test( name ) ) {
return {
type: 'Identifier',
start,

View File

@ -3,12 +3,12 @@ export default {
class: 'foo'
},
html: `<div class="foo"></div>`,
html: `<div class="foo"></div>123`,
test ( assert, component, target ) {
component.set({ class: 'bar' });
assert.equal( target.innerHTML, `<div class="bar"></div>` );
assert.equal( target.innerHTML, `<div class="bar"></div>123` );
component.destroy();
}
};

View File

@ -1 +1 @@
<div class='{{class}}'></div>
<div class='{{class}}'></div>{{123}}