chore: sanitize file path when saving (#99)
Fixes https://github.com/microsoft/playwright-mcp/issues/96
This commit is contained in:
parent
aeb4cf65e9
commit
d316441142
4 changed files with 32 additions and 7 deletions
|
|
@ -106,3 +106,7 @@ export async function captureAriaSnapshot(context: Context, status: string = '')
|
|||
content: [{ type: 'text', text: lines.join('\n') }],
|
||||
};
|
||||
}
|
||||
|
||||
export function sanitizeForFilePath(s: string) {
|
||||
return s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, '-');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue