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

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

@ -1,5 +1,15 @@
# 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
* Fix placement of each-else block ([#2917](https://github.com/sveltejs/svelte/issues/2917))

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

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

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

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

@ -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