Skip to content

Commit 51a6665

Browse files
committed
fix(files): use replacer function to prevent $ special-char corruption in markdown URL rewrite
1 parent af7cc43 commit 51a6665

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • apps/sim/app/api/files/export/[id]

apps/sim/app/api/files/export/[id]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ export const GET = withRouteHandler(
124124

125125
for (const [imageId, asset] of assetMap) {
126126
const escapedId = imageId.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
127+
const replacement = `./assets/${asset.filename}`
127128
mdContent = mdContent.replace(
128129
new RegExp(`/api/files/view/${escapedId}`, 'g'),
129-
`./assets/${asset.filename}`
130+
() => replacement
130131
)
131132
}
132133

0 commit comments

Comments
 (0)