Merge branch 'master' of github.com:sveltejs/svelte

pull/3156/head
Rich Harris 6 years ago
commit 9883a50bf9

@ -1,5 +1,15 @@
# Svelte changelog # Svelte changelog
## 3.6.3
* Fix await block mounting inside removed if block ([#1496](https://github.com/sveltejs/svelte/issues/1496))
* Update when element references are removed ([#2034](https://github.com/sveltejs/svelte/issues/2034))
* Don't attempt to serialize non-string values in server-rendered bindings ([#2135](https://github.com/sveltejs/svelte/issues/2135))
* Recognise dependencies in function expressions ([#2693](https://github.com/sveltejs/svelte/issues/2693))
* Scope pseudo-class selectors without class/type ([#1705](https://github.com/sveltejs/svelte/issues/1705))
* Allow nested at-rules ([#3135](https://github.com/sveltejs/svelte/issues/3135))
* Allow attributes to contain `=` characters ([#3149](https://github.com/sveltejs/svelte/pull/3149))
## 3.6.2 ## 3.6.2
* Fix placement of each-else block ([#2917](https://github.com/sveltejs/svelte/issues/2917)) * Fix placement of each-else block ([#2917](https://github.com/sveltejs/svelte/issues/2917))

@ -1,6 +1,6 @@
{ {
"name": "svelte", "name": "svelte",
"version": "3.6.2", "version": "3.6.3",
"description": "Cybernetically enhanced web apps", "description": "Cybernetically enhanced web apps",
"module": "index.mjs", "module": "index.mjs",
"main": "index", "main": "index",

@ -269,7 +269,7 @@ export default class Stylesheet {
this.has_styles = true; this.has_styles = true;
const stack: Array<Atrule> = []; const stack: Atrule[] = [];
let depth = 0; let depth = 0;
let current_atrule: Atrule = null; let current_atrule: Atrule = null;

@ -36,7 +36,7 @@ export default function bind_this(component: Component, block: Block, binding: B
: deindent` : deindent`
${lhs} = $$value; ${lhs} = $$value;
${component.invalidate(object)}; ${component.invalidate(object)};
` `;
} }
const contextual_dependencies = Array.from(binding.expression.contextual_dependencies); const contextual_dependencies = Array.from(binding.expression.contextual_dependencies);

@ -21,17 +21,17 @@ interface Processed {
dependencies?: string[]; dependencies?: string[];
} }
function parse_attribute_value(value: string) {
return /^['"]/.test(value) ?
value.slice(1, -1) :
value;
}
function parse_attributes(str: string) { function parse_attributes(str: string) {
const attrs = {}; const attrs = {};
str.split(/\s+/).filter(Boolean).forEach(attr => { str.split(/\s+/).filter(Boolean).forEach(attr => {
const [name, value] = attr.split('='); const p = attr.indexOf('=');
attrs[name] = value ? parse_attribute_value(value) : true; if (p === -1) {
attrs[attr] = true;
} else {
attrs[attr.slice(0, p)] = `'"`.includes(attr[p + 1]) ?
attr.slice(p + 2, -1) :
attr.slice(p + 1);
}
}); });
return attrs; return attrs;
} }

@ -0,0 +1,5 @@
export default {
preprocess: {
style: ({ attributes }) => attributes.foo && attributes.foo.includes('=') ? { code: '' } : null
}
};

@ -0,0 +1,3 @@
<style foo="bar=baz">
foo {}
</style>
Loading…
Cancel
Save