Skip to content

Commit 5668fbb

Browse files
author
Nathan Huisman
authoredAug 28, 2023
fix(compiler-solid): Props replacement not working with multiline starttags (#301)
1 parent 902e2b9 commit 5668fbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/core/compilers/solid.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Compiler } from './types'
22

33
export const SolidCompiler = ((svg: string) => {
4-
const svgWithProps = svg.replace(/([{}])/g, '{\'$1\'}').replace(/(?<=<svg.*?)(>)/i, '{...props}>')
4+
const svgWithProps = svg.replace(/([{}])/g, '{\'$1\'}').replace(/(?<=<svg[\s\S]*?)(>)/i, '{...props}>')
55
return `export default (props = {}) => ${svgWithProps}`
66
}) as Compiler

0 commit comments

Comments
 (0)
Please sign in to comment.