Skip to content

Commit 0c97366

Browse files
committed
develop:
1 parent 6a6bd9e commit 0c97366

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "git-graph",
33
"displayName": "Git Graph",
4-
"version": "1.30.0",
4+
"version": "1.30.1",
55
"publisher": "mhutchie",
66
"author": {
77
"name": "Michael Hutchison",

src/gitDiffView.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export class GitDiffView extends Disposable {
198198
private getHtmlForWebview(diffContent: string): string {
199199
const nonce = getNonce();
200200
this.logger.appendLine(`handle ${this.escapedStr} automatically`);
201+
const encodedDiffContent = encodeURIComponent(diffContent);
201202
return /* html */ `
202203
<!DOCTYPE html>
203204
<html lang="en" id="diff-2-html">
@@ -226,7 +227,7 @@ export class GitDiffView extends Disposable {
226227
jQuery('#git-diff-body').on('click','.custom-git-btn',function(evt){
227228
_vscodeApi.postMessage(jQuery(this).data());
228229
});
229-
const diffContent = \`${this.getEscapedDiffContent(diffContent)}\`;
230+
const diffContent = decodeURIComponent("${encodedDiffContent}");
230231
const configuration = {
231232
drawFileList: true,
232233
fileListToggle: true,
@@ -276,11 +277,11 @@ export class GitDiffView extends Disposable {
276277
</html>`;
277278
}
278279

279-
private getEscapedDiffContent(diff:string):string {
280-
diff = diff.replace(/[\\`\$]/g, '\\$&');
281-
diff = diff.replace(/</g, '${escapedStr}');
282-
return diff;
283-
}
280+
// private getEscapedDiffContent(diff:string):string {
281+
// diff = diff.replace(/[\\`\$]/g, '\\$&');
282+
// diff = diff.replace(/</g, '${escapedStr}');
283+
// return diff;
284+
// }
284285
/* URI Manipulation Methods */
285286
private getMediaUri(file: string) {
286287
return this.panel.webview.asWebviewUri(this.getUri('media', file));

0 commit comments

Comments
 (0)