Skip to content

Commit f39eb5f

Browse files
committed
fix
1 parent ef9ef49 commit f39eb5f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/create-svelte/templates/default/src/routes/sverdle/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
stageHeight: window.innerHeight,
201201
colors: ['#ff3e00', '#40b3ff', '#676778']
202202
}}
203-
></div>
203+
></div>
204204
{/if}
205205

206206
<style>

packages/migrate/migrations/self-closing-tags/migrate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const SVGElements = [
110110
* @param {string} code
111111
*/
112112
export function remove_self_closing_tags(code) {
113-
return code.replace(/<([a-z-]+)(\s[^>]+?)?\s?\/>/g, (match, name, attributes = '') => {
113+
return code.replace(/<([a-z-]+)(\s[^>]+?)? ?\/>/g, (match, name, attributes = '') => {
114114
if (VoidElements.includes(name) || SVGElements.includes(name)) return match;
115115
return `<${name}${attributes}></${name}>`;
116116
});

packages/migrate/migrations/self-closing-tags/migrate.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const tests = {
77
'<div />': '<div></div>',
88
'<div class="foo"/>': '<div class="foo"></div>',
99
'<div class="foo" />': '<div class="foo"></div>',
10+
'\t<div\n\t\tonclick={blah}\n\t/>': '\t<div\n\t\tonclick={blah}\n\t></div>',
1011
'<foo-bar/>': '<foo-bar></foo-bar>',
1112
'<link/>': '<link/>',
1213
'<link />': '<link />',

0 commit comments

Comments
 (0)