Skip to content

Commit

Permalink
fix(compiler-solid): Props replacement not working with multiline sta…
Browse files Browse the repository at this point in the history
…rttags (#301)
  • Loading branch information
Nathan Huisman authored Aug 28, 2023
1 parent 902e2b9 commit 5668fbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/compilers/solid.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Compiler } from './types'

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

0 comments on commit 5668fbb

Please sign in to comment.