Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-link-check

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-link-check - npm Package Compare versions

Comparing version 3.11.2 to 3.12.0

6

index.js

@@ -64,3 +64,3 @@ 'use strict';

const { links, anchors } = markdownLinkExtractor(markdown);
const links = markdownLinkExtractor(markdown);
const linksCollection = _.uniq(links);

@@ -75,4 +75,2 @@ const bar = (opts.showProgressBar) ?

opts.anchors = anchors;
async.mapLimit(linksCollection, 2, function (link, callback) {

@@ -94,3 +92,3 @@ if (opts.ignorePatterns) {

for (let replacementPattern of opts.replacementPatterns) {
let pattern = replacementPattern.pattern instanceof RegExp ? replacementPattern.pattern : new RegExp(replacementPattern.pattern);
let pattern = replacementPattern.pattern instanceof RegExp ? replacementPattern.pattern : new RegExp(replacementPattern.pattern, replacementPattern.global ? 'g' : '');
link = link.replace(pattern, performSpecialReplacements(replacementPattern.replacement, opts));

@@ -97,0 +95,0 @@ }

@@ -1,2 +0,2 @@

Copyright (c) 2016-2022 Thomas Cort <linuxgeek@gmail.com>
Copyright (c) 2016-2024 Thomas Cort <linuxgeek@gmail.com>

@@ -3,0 +3,0 @@ Permission to use, copy, modify, and distribute this software for any

{
"name": "markdown-link-check",
"version": "3.11.2",
"version": "3.12.0",
"description": "checks the all of the hyperlinks in a markdown text to determine if they are alive or dead",

@@ -36,17 +36,18 @@ "bin": {

"dependencies": {
"async": "^3.2.4",
"async": "^3.2.5",
"chalk": "^5.2.0",
"commander": "^10.0.1",
"link-check": "^5.2.0",
"link-check": "^5.3.0",
"lodash": "^4.17.21",
"markdown-link-extractor": "^3.1.0",
"needle": "^3.2.0",
"progress": "^2.0.3"
"markdown-link-extractor": "^4.0.2",
"needle": "^3.3.1",
"progress": "^2.0.3",
"proxy-agent": "^6.4.0"
},
"devDependencies": {
"eslint": "^8.39.0",
"eslint": "^8.57.0",
"expect.js": "^0.3.1",
"express": "^4.18.2",
"mocha": "^10.2.0"
"express": "^4.18.3",
"mocha": "^10.3.0"
}
}

@@ -69,3 +69,2 @@ ![Test library workflow status](https://github.com/tcort/markdown-link-check/workflows/Test%20library/badge.svg)

* `opts` optional options object containing any of the following optional fields:
* `baseUrl` the base URL for relative links.
* `showProgressBar` enable an ASCII progress bar.

@@ -75,3 +74,3 @@ * `timeout` timeout in [zeit/ms](https://www.npmjs.com/package/ms) format. (e.g. `"2000ms"`, `20s`, `1m`). Default `10s`.

* `ignorePatterns` an array of objects holding regular expressions which a link is checked against and skipped for checking in case of a match. Example: `[{ pattern: /foo/ }]`
* `replacementPatterns` an array of objects holding regular expressions which are replaced in a link with their corresponding replacement string. This behavior allows (for example) to adapt to certain platform conventions hosting the Markdown. The special replacement `{{BASEURL}}` can be used to dynamically link to the base folder (used from `projectBaseUrl`) (for example that `/` points to the root of your local repository). Example: `[{ pattern: /^.attachments/, replacement: "file://some/conventional/folder/.attachments" }, { pattern: ^/, replacement: "{{BASEURL}}/"}]`
* `replacementPatterns` an array of objects holding regular expressions which are replaced in a link with their corresponding replacement string. This behavior allows (for example) to adapt to certain platform conventions hosting the Markdown. The special replacement `{{BASEURL}}` can be used to dynamically link to the base folder (used from `projectBaseUrl`) (for example that `/` points to the root of your local repository). Example: `[{ pattern: /^.attachments/, replacement: "file://some/conventional/folder/.attachments" }, { pattern: ^/, replacement: "{{BASEURL}}/"}]`. You can add `"global": true` to use a global regular expression to replace all instances.
* `projectBaseUrl` the URL to use for `{{BASEURL}}` replacement

@@ -175,10 +174,11 @@ * `ignoreDisable` if this is `true` then disable comments are ignored.

Options:
-p, --progress show progress bar
-c, --config [config] apply a config file (JSON), holding e.g. url specific header configuration
-q, --quiet displays errors only
-v, --verbose displays detailed error information
-a, --alive <code> comma separated list of HTTP code to be considered as alive
-r, --retry retry after the duration indicated in 'retry-after' header when HTTP code is 429
-h, --help display help for command
-V, --version display version string (e.g. `1.2.3`)
-p, --progress show progress bar
-c, --config [config] apply a config file (JSON), holding e.g. url specific header configuration
-q, --quiet displays errors only
-v, --verbose displays detailed error information
-a, --alive <code> comma separated list of HTTP code to be considered as alive
-r, --retry retry after the duration indicated in 'retry-after' header when HTTP code is 429
-h, --help display help for command
-V, --version display version string (e.g. `1.2.3`)
, --projectBaseUrl <url> the URL to use for {{BASEURL}} replacement
```

@@ -198,2 +198,3 @@

* `aliveStatusCodes` a list of HTTP codes to consider as alive.
* `projectBaseUrl` the URL to use for `{{BASEURL}}` replacement

@@ -204,2 +205,3 @@ **Example:**

{
"projectBaseUrl":"${workspaceFolder}",
"ignorePatterns": [

@@ -218,2 +220,7 @@ {

"replacement": "{{BASEURL}}/"
},
{
"pattern": "%20",
"replacement": "-",
"global": true
}

@@ -220,0 +227,0 @@ ],

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc