mirror of https://github.com/sveltejs/svelte
Merge 82f79a6e6e into 5895c637b0
commit
4f0d0b3292
@ -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