Skip to content

Commit 83163ed

Browse files
committed
fixes #542
1 parent 88c77f5 commit 83163ed

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ module.exports = function (argv: string[]): void {
8787
.option('--yarn', 'Use yarn instead of npm (default inferred from presence of yarn.lock or .yarnrc)')
8888
.option('--no-yarn', 'Use npm instead of yarn (default inferred from lack of yarn.lock or .yarnrc)')
8989
.option('--ignoreFile [path]', 'Indicate alternative .vscodeignore')
90-
.option('--noGitHubIssueLinking', 'Prevent automatic expansion of GitHub-style issue syntax into links')
90+
.option('--no-gitHubIssueLinking', 'Disable automatic expansion of GitHub-style issue syntax into links')
9191
.option(
9292
'--web',
9393
'Experimental flag to enable publishing web extensions. Note: This is supported only for selected extensions.'
9494
)
95-
.action(({ out, githubBranch, baseContentUrl, baseImagesUrl, yarn, ignoreFile, noGitHubIssueLinking, web }) =>
95+
.action(({ out, githubBranch, baseContentUrl, baseImagesUrl, yarn, ignoreFile, gitHubIssueLinking, web }) =>
9696
main(
9797
packageCommand({
9898
packagePath: out,
@@ -101,7 +101,7 @@ module.exports = function (argv: string[]): void {
101101
baseImagesUrl,
102102
useYarn: yarn,
103103
ignoreFile,
104-
expandGitHubIssueLinks: noGitHubIssueLinking,
104+
gitHubIssueLinking,
105105
web,
106106
})
107107
)

src/package.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ export interface IAsset {
7676
}
7777

7878
export interface IPackageOptions {
79-
cwd?: string;
80-
packagePath?: string;
81-
githubBranch?: string;
82-
baseContentUrl?: string;
83-
baseImagesUrl?: string;
84-
useYarn?: boolean;
85-
dependencyEntryPoints?: string[];
86-
ignoreFile?: string;
87-
expandGitHubIssueLinks?: boolean;
88-
web?: boolean;
79+
readonly cwd?: string;
80+
readonly packagePath?: string;
81+
readonly githubBranch?: string;
82+
readonly baseContentUrl?: string;
83+
readonly baseImagesUrl?: string;
84+
readonly useYarn?: boolean;
85+
readonly dependencyEntryPoints?: string[];
86+
readonly ignoreFile?: string;
87+
readonly gitHubIssueLinking?: boolean;
88+
readonly web?: boolean;
8989
}
9090

9191
export interface IProcessor {
@@ -421,7 +421,7 @@ export class MarkdownProcessor extends BaseProcessor {
421421
private baseImagesUrl: string;
422422
private isGitHub: boolean;
423423
private repositoryUrl: string;
424-
private expandGitHubIssueLinks: boolean;
424+
private gitHubIssueLinking: boolean;
425425

426426
constructor(
427427
manifest: Manifest,
@@ -438,8 +438,7 @@ export class MarkdownProcessor extends BaseProcessor {
438438
this.baseImagesUrl = options.baseImagesUrl || options.baseContentUrl || (guess && guess.images);
439439
this.repositoryUrl = guess && guess.repository;
440440
this.isGitHub = isGitHubRepository(this.repositoryUrl);
441-
this.expandGitHubIssueLinks =
442-
typeof options.expandGitHubIssueLinks === 'boolean' ? options.expandGitHubIssueLinks : true;
441+
this.gitHubIssueLinking = typeof options.gitHubIssueLinking === 'boolean' ? options.gitHubIssueLinking : true;
443442
}
444443

445444
async onFile(file: IFile): Promise<IFile> {
@@ -506,7 +505,7 @@ export class MarkdownProcessor extends BaseProcessor {
506505
return all.replace(link, urljoin(prefix, link));
507506
});
508507

509-
if (this.isGitHub && this.expandGitHubIssueLinks) {
508+
if (this.gitHubIssueLinking && this.isGitHub) {
510509
const markdownIssueRegex = /(\s|\n)([\w\d_-]+\/[\w\d_-]+)?#(\d+)\b/g;
511510
const issueReplace = (
512511
all: string,

src/test/package.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1999,7 +1999,7 @@ describe('MarkdownProcessor', () => {
19991999
};
20002000

20012001
const root = fixture('readme');
2002-
const processor = new ReadmeProcessor(manifest, { expandGitHubIssueLinks: false });
2002+
const processor = new ReadmeProcessor(manifest, { gitHubIssueLinking: false });
20032003
const readme = {
20042004
path: 'extension/readme.md',
20052005
localPath: path.join(root, 'readme.github.md'),

0 commit comments

Comments
 (0)