Merge pull request #472 from JeffreyCA/jeffreyca/mailto-fix

Prevent mailto links from being joined with prefix
This commit is contained in:
João Moreno 2020-08-03 17:00:23 +02:00 committed by GitHub
commit 638e34f818
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 1 deletions

View file

@ -390,7 +390,11 @@ export class MarkdownProcessor extends BaseProcessor {
}
const markdownPathRegex = /(!?)\[([^\]\[]*|!\[[^\]\[]*]\([^\)]+\))\]\(([^\)]+)\)/g;
const urlReplace = (_, isImage, title, link) => {
const urlReplace = (_, isImage, title, link: string) => {
if (/^mailto:/i.test(link)) {
return `${isImage}[${title}](${link})`;
}
const isLinkRelative = !/^\w+:\/\//.test(link) && link[0] !== '#';
if (!this.baseContentUrl && !this.baseImagesUrl) {

View file

@ -31,6 +31,7 @@ The `spellMD.json` config file is watched so you can add more ignores or change
[mono](https://github.com/username/repository/blob/master/monkey)
[not](http://shouldnottouchthis/)
[Email me](mailto:example@example.com)
# Install
This extension is published in the VS Code Gallery. So simply hit 'F1' and type 'ext inst' from there select `SpellMD` and follow instructions.

View file

@ -12,3 +12,4 @@
* foo/$234/#7
* [#7](http://shouldnottouchthis/)
* [other/repositoryName#8](http://shouldnottouchthis/)
* [Email me](MAILTO:example@example.com)

View file

@ -12,3 +12,4 @@
* foo/$234/#7
* [#7](http://shouldnottouchthis/)
* [other/repositoryName#8](http://shouldnottouchthis/)
* [Email me](MAILTO:example@example.com)

View file

@ -31,6 +31,7 @@ The `spellMD.json` config file is watched so you can add more ignores or change
[mono](https://github.com/username/repository/blob/master/monkey)
[not](http://shouldnottouchthis/)
[Email me](mailto:example@example.com)
# Install
This extension is published in the VS Code Gallery. So simply hit 'F1' and type 'ext inst' from there select `SpellMD` and follow instructions.

View file

@ -31,6 +31,7 @@ The `spellMD.json` config file is watched so you can add more ignores or change
[mono](monkey)
[not](http://shouldnottouchthis/)
[Email me](mailto:example@example.com)
# Install
This extension is published in the VS Code Gallery. So simply hit 'F1' and type 'ext inst' from there select `SpellMD` and follow instructions.