Skip to content

Commit

Permalink
Escape shortcut string in build.gradle (#761)
Browse files Browse the repository at this point in the history
Fixes #760
  • Loading branch information
andreban authored Feb 7, 2023
1 parent 5a419db commit c85ff25
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/lib/ShortcutInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

'use strict';

import {findSuitableIcon} from './util';
import {findSuitableIcon, escapeGradleString} from './util';
import {WebManifestShortcutJson, WebManifestIcon} from './types/WebManifest';

// As described on https://developer.chrome.com/apps/manifest/name#short_name
Expand Down Expand Up @@ -47,8 +47,10 @@ export class ShortcutInfo {
}

toString(index: number): string {
return `[name:'${this.name}', short_name:'${this.shortName}', ` +
`url:'${this.url}', icon:'${this.assetName(index)}']`;
return `[name:'${escapeGradleString(this.name)}', ` +
`short_name:'${escapeGradleString(this.shortName)}', ` +
`url:'${this.url}', ` +
`icon:'${this.assetName(index)}']`;
}

assetName(index: number): string {
Expand Down

0 comments on commit c85ff25

Please sign in to comment.