fix: correctly process empty lines in message markdown (#12057)

pull/12062/head
Rich Harris 1 year ago committed by GitHub
parent 909f88287a
commit 7a0ce2dfea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: correctly process empty lines in messages

@ -43,7 +43,7 @@ for (const category of fs.readdirSync('messages')) {
seen.add(code); seen.add(code);
messages[category][code] = { messages[category][code] = {
messages: sections.map((section) => section.replace(/^> /gm, '')), messages: sections.map((section) => section.replace(/^> /gm, '').replace(/^>\n/gm, '\n')),
details details
}; };
} }

@ -280,13 +280,13 @@ export function state_prototype_fixed() {
/** /**
* Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. This can lead to unexpected errors and possibly cause infinite loops. * Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. This can lead to unexpected errors and possibly cause infinite loops.
* > *
* If the object is not meant to be reactive, declare it without `$state` * If the object is not meant to be reactive, declare it without `$state`
* @returns {never} * @returns {never}
*/ */
export function state_unsafe_mutation() { export function state_unsafe_mutation() {
if (DEV) { if (DEV) {
const error = new Error(`${"state_unsafe_mutation"}\n${"Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. This can lead to unexpected errors and possibly cause infinite loops.\n>\nIf the object is not meant to be reactive, declare it without `$state`"}`); const error = new Error(`${"state_unsafe_mutation"}\n${"Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. This can lead to unexpected errors and possibly cause infinite loops.\n\nIf the object is not meant to be reactive, declare it without `$state`"}`);
error.name = 'Svelte error'; error.name = 'Svelte error';
throw error; throw error;

Loading…
Cancel
Save