Skip to content

Commit e812916

Browse files
committedJan 20, 2025·
fix(build): escape $ in replace pattern in dynamic routes plugin
closes #4499
1 parent 36eb751 commit e812916

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/node/plugins/dynamicRoutesPlugin.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ export const dynamicRoutesPlugin = async (
132132
// we use a special injection syntax so the content is rendered as
133133
// static local content instead of included as runtime data.
134134
if (content) {
135-
baseContent = baseContent.replace(/<!--\s*@content\s*-->/, content)
135+
baseContent = baseContent.replace(
136+
/<!--\s*@content\s*-->/,
137+
content.replace(/\$/g, '$$$')
138+
)
136139
}
137140

138141
// params are injected with special markers and extracted as part of

0 commit comments

Comments
 (0)
Please sign in to comment.