Skip to content

Commit

Permalink
fix(build): escape $ in replace pattern in dynamic routes plugin
Browse files Browse the repository at this point in the history
closes #4499
  • Loading branch information
brc-dd committed Jan 20, 2025
1 parent 36eb751 commit e812916
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node/plugins/dynamicRoutesPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ export const dynamicRoutesPlugin = async (
// we use a special injection syntax so the content is rendered as
// static local content instead of included as runtime data.
if (content) {
baseContent = baseContent.replace(/<!--\s*@content\s*-->/, content)
baseContent = baseContent.replace(
/<!--\s*@content\s*-->/,
content.replace(/\$/g, '$$$')
)
}

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

0 comments on commit e812916

Please sign in to comment.