Skip to content

Commit d54545b

Browse files
committed
fix: improve regex pattern for terminal command tags
- Change regex from (.*?) to ([\s\S]*?) to properly handle multiline content - This should fix the issue where <run_terminal_cmd> tags appear as literal text - Terminal commands should now be parsed correctly and not displayed in chat UI
1 parent 4d8153f commit d54545b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dyad/src/components/chat/DyadMarkdownParser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function parseCustomTags(content: string): ContentPiece[] {
200200
];
201201

202202
const tagPattern = new RegExp(
203-
`<(${customTagNames.join("|")})\\s*([^>]*)>(.*?)<\\/\\1>`,
203+
`<(${customTagNames.join("|")})\\s*([^>]*)>([\\s\\S]*?)<\\/\\1>`,
204204
"gs",
205205
);
206206

0 commit comments

Comments
 (0)