diff --git a/src/package.ts b/src/package.ts index 119544b7..8a3b20f2 100644 --- a/src/package.ts +++ b/src/package.ts @@ -626,13 +626,13 @@ export class MarkdownProcessor extends BaseProcessor { } async onFile(file: IFile): Promise { - const path = util.normalize(file.path); + const filePath = util.normalize(file.path); - if (!this.regexp.test(path)) { + if (!this.regexp.test(filePath)) { return Promise.resolve(file); } - this.assets.push({ type: this.assetType, path }); + this.assets.push({ type: this.assetType, path: filePath }); let contents = await read(file); @@ -665,7 +665,7 @@ export class MarkdownProcessor extends BaseProcessor { return `${isImage}[${title}](${link})`; } - return `${isImage}[${title}](${urljoin(prefix, link)})`; + return `${isImage}[${title}](${urljoin(prefix, path.normalize(link))})`; }; // Replace Markdown links with urls @@ -686,7 +686,7 @@ export class MarkdownProcessor extends BaseProcessor { return all; } - return all.replace(link, urljoin(prefix, link)); + return all.replace(link, urljoin(prefix, path.normalize(link))); }); if ((this.gitHubIssueLinking && this.isGitHub) || (this.gitLabIssueLinking && this.isGitLab)) { diff --git a/src/test/fixtures/readme/readme.branch.main.expected.md b/src/test/fixtures/readme/readme.branch.main.expected.md index d6ef3666..7058873a 100644 --- a/src/test/fixtures/readme/readme.branch.main.expected.md +++ b/src/test/fixtures/readme/readme.branch.main.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://github.com/username/repository/raw/main/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://github.com/username/repository/raw/main/images/SpellMDDemo2.gif)](https://github.com/username/repository/blob/main/monkey) ![](https://github.com/username/repository/raw/main/images/SpellMDDemo2.gif) +![](https://github.com/username/repository/raw/main/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.branch.override.content.expected.md b/src/test/fixtures/readme/readme.branch.override.content.expected.md index 8bf6e2c9..1f59d470 100644 --- a/src/test/fixtures/readme/readme.branch.override.content.expected.md +++ b/src/test/fixtures/readme/readme.branch.override.content.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://github.com/base/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://github.com/base/images/SpellMDDemo2.gif)](https://github.com/base/monkey) ![](https://github.com/base/images/SpellMDDemo2.gif) +![](https://github.com/base/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.branch.override.images.expected.md b/src/test/fixtures/readme/readme.branch.override.images.expected.md index 9df6b7e9..ea96add2 100644 --- a/src/test/fixtures/readme/readme.branch.override.images.expected.md +++ b/src/test/fixtures/readme/readme.branch.override.images.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://github.com/base/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://github.com/base/images/SpellMDDemo2.gif)](https://github.com/username/repository/blob/main/monkey) ![](https://github.com/base/images/SpellMDDemo2.gif) +![](https://github.com/base/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.default.md b/src/test/fixtures/readme/readme.default.md index 311ed321..2be2f213 100644 --- a/src/test/fixtures/readme/readme.default.md +++ b/src/test/fixtures/readme/readme.default.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://github.com/username/repository/raw/HEAD/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://github.com/username/repository/raw/HEAD/images/SpellMDDemo2.gif)](https://github.com/username/repository/blob/HEAD/monkey) ![](https://github.com/username/repository/raw/HEAD/images/SpellMDDemo2.gif) +![](https://github.com/username/repository/raw/HEAD/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.expected.md b/src/test/fixtures/readme/readme.expected.md index 46ab381d..bfc89854 100644 --- a/src/test/fixtures/readme/readme.expected.md +++ b/src/test/fixtures/readme/readme.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://github.com/username/repository/raw/master/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://github.com/username/repository/raw/master/images/SpellMDDemo2.gif)](https://github.com/username/repository/blob/master/monkey) ![](https://github.com/username/repository/raw/master/images/SpellMDDemo2.gif) +![](https://github.com/username/repository/raw/master/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.gitlab.branch.main.expected.md b/src/test/fixtures/readme/readme.gitlab.branch.main.expected.md index 6bcde929..0f889d71 100644 --- a/src/test/fixtures/readme/readme.gitlab.branch.main.expected.md +++ b/src/test/fixtures/readme/readme.gitlab.branch.main.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://gitlab.com/username/repository/-/raw/main/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://gitlab.com/username/repository/-/raw/main/images/SpellMDDemo2.gif)](https://gitlab.com/username/repository/-/blob/main/monkey) ![](https://gitlab.com/username/repository/-/raw/main/images/SpellMDDemo2.gif) +![](https://gitlab.com/username/repository/-/raw/main/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.gitlab.branch.override.content.expected.md b/src/test/fixtures/readme/readme.gitlab.branch.override.content.expected.md index 6bb9682e..648090c8 100644 --- a/src/test/fixtures/readme/readme.gitlab.branch.override.content.expected.md +++ b/src/test/fixtures/readme/readme.gitlab.branch.override.content.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://gitlab.com/base/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://gitlab.com/base/images/SpellMDDemo2.gif)](https://gitlab.com/base/monkey) ![](https://gitlab.com/base/images/SpellMDDemo2.gif) +![](https://gitlab.com/base/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.gitlab.branch.override.images.expected.md b/src/test/fixtures/readme/readme.gitlab.branch.override.images.expected.md index c0ec04d9..5beb7b7c 100644 --- a/src/test/fixtures/readme/readme.gitlab.branch.override.images.expected.md +++ b/src/test/fixtures/readme/readme.gitlab.branch.override.images.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://gitlab.com/base/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://gitlab.com/base/images/SpellMDDemo2.gif)](https://gitlab.com/username/repository/-/blob/main/monkey) ![](https://gitlab.com/base/images/SpellMDDemo2.gif) +![](https://gitlab.com/base/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.gitlab.default.md b/src/test/fixtures/readme/readme.gitlab.default.md index 314b2365..54b5b499 100644 --- a/src/test/fixtures/readme/readme.gitlab.default.md +++ b/src/test/fixtures/readme/readme.gitlab.default.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://gitlab.com/username/repository/-/raw/HEAD/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://gitlab.com/username/repository/-/raw/HEAD/images/SpellMDDemo2.gif)](https://gitlab.com/username/repository/-/blob/HEAD/monkey) ![](https://gitlab.com/username/repository/-/raw/HEAD/images/SpellMDDemo2.gif) +![](https://gitlab.com/username/repository/-/raw/HEAD/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.images.expected.md b/src/test/fixtures/readme/readme.images.expected.md index c0f6ec21..b713c290 100644 --- a/src/test/fixtures/readme/readme.images.expected.md +++ b/src/test/fixtures/readme/readme.images.expected.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](https://github.com/username/repository/path/to/images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](https://github.com/username/repository/path/to/images/SpellMDDemo2.gif)](https://github.com/username/repository/blob/HEAD/monkey) ![](https://github.com/username/repository/path/to/images/SpellMDDemo2.gif) +![](https://github.com/username/repository/path/to/SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will. diff --git a/src/test/fixtures/readme/readme.md b/src/test/fixtures/readme/readme.md index c28a5ee0..73a8c557 100644 --- a/src/test/fixtures/readme/readme.md +++ b/src/test/fixtures/readme/readme.md @@ -21,6 +21,7 @@ The status bar lets you quickly navigate to any issue and you can see all positi [![Jump to issues](images/SpellMDDemo2.gif)](http://shouldnottouchthis/) [![Jump to issues](images/SpellMDDemo2.gif)](monkey) ![](images/SpellMDDemo2.gif) +![](./SpellMDDemo2.gif) The `spellMD.json` config file is watched so you can add more ignores or change mappings at will.