Skip to content

Commit

Permalink
fix: fix copy to curl escape issue
Browse files Browse the repository at this point in the history
Signed-off-by: seven <[email protected]>
  • Loading branch information
Blankll committed Oct 13, 2024
1 parent e6b1c11 commit 508a9a8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/common/monaco/tokenlizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ export const transformQDSL = ({ path, qdsl }: Pick<SearchAction, 'path' | 'qdsl'
.join('\n');
return `${bulkQdsl}\n`;
}
console.log('qdsl:', qdsl);

console.log('replaced-qdsl:', replaceTripleQuotes(qdsl));

return qdsl ? JSON.stringify(JSON5.parse(replaceTripleQuotes(qdsl)), null, 2) : undefined;
} catch (err) {
Expand Down Expand Up @@ -177,7 +174,8 @@ export const transformToCurl = ({
.join('');
}
if (qdsl) {
curlCmd += ` -d '${transformQDSL({ path: url, qdsl })}'`;
const qdslCmd = transformQDSL({ path: url, qdsl })?.replace(/'/g, "'\\''");
curlCmd += ` -d '${qdslCmd}'`;
}

return curlCmd;
Expand Down

0 comments on commit 508a9a8

Please sign in to comment.