diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e8e1658629c..0a780fd8cf99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Svelte changelog +## 1.10.3 + +* Prevent `''` string occurence breaking pages ([#349](https://github.com/sveltejs/svelte/pull/349)) +* Allow reference to whitelisted globals without properties ([#333](https://github.com/sveltejs/svelte/pull/333)) +* Don't remove ` ` incorrectly ([#348](https://github.com/sveltejs/svelte/issues/348)) +* `let` -> `var` in `addCss` block ([#351](https://github.com/sveltejs/svelte/pull/351)) + +## 1.10.2 + +* Accept any case for doctype declarations ([#336](https://github.com/sveltejs/svelte/issues/336)) +* Allow non-top-level `' ) ) { + if ( parser.eat( '<\/script>' ) ) { break; } } diff --git a/src/parse/state/tag.js b/src/parse/state/tag.js index 09eda8da9cc1..c6007318af13 100644 --- a/src/parse/state/tag.js +++ b/src/parse/state/tag.js @@ -4,7 +4,7 @@ import readStyle from '../read/style.js'; import { readEventHandlerDirective, readBindingDirective } from '../read/directives.js'; import { trimStart, trimEnd } from '../utils/trim.js'; import { decodeCharacterReferences } from '../utils/html.js'; -import voidElementNames from '../../utils/voidElementNames.js'; +import isVoidElementName from '../../utils/isVoidElementName.js'; const validTagName = /^\!?[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/; const invalidUnquotedAttributeCharacters = /[\s"'=<>\/`]/; @@ -84,7 +84,7 @@ export default function tag ( parser ) { parser.allowWhitespace(); if ( isClosingTag ) { - if ( voidElementNames.test( name ) ) { + if ( isVoidElementName( name ) ) { parser.error( `<${name}> is a void element and cannot have children, or a closing tag`, start ); } @@ -130,13 +130,13 @@ export default function tag ( parser ) { parser.allowWhitespace(); - // special cases – + `; + + const { code } = svelte.compile( source, { + format: 'eval', + globals: { + answer: 'answer' + } + }); + + return testEval( code, 'Foo', { answer: 42 }, `