mirror of https://github.com/sveltejs/svelte
parent
44a7813730
commit
82f79a6e6e
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: do not consider `style` literals inside `<script>` blocks
|
||||
@ -0,0 +1,13 @@
|
||||
import * as assert from 'node:assert';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
preprocess: {
|
||||
style: ({ content }) => {
|
||||
assert.equal(content, 'BEFORE');
|
||||
return {
|
||||
code: 'PROCESSED'
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
const scope = (rules) => `<style>${rules.replaceAll('::highlight(a-', '::highlight(b-')}</style>`;
|
||||
</script>
|
||||
|
||||
<style>BEFORE</style>
|
||||
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
const scope = (rules) => `<style>${rules.replaceAll('::highlight(a-', '::highlight(b-')}</style>`;
|
||||
</script>
|
||||
|
||||
<style>PROCESSED</style>
|
||||
Loading…
Reference in new issue