diff --git a/lib/extract-markdown-hyperlinks.js b/lib/extract-markdown-hyperlinks.js index 7817eb4..d8c32ab 100644 --- a/lib/extract-markdown-hyperlinks.js +++ b/lib/extract-markdown-hyperlinks.js @@ -11,14 +11,14 @@ import { visit } from "unist-util-visit"; // options (optional) - An object specifying additional settings // - ignorePatterns (optional) - An array of objects holding regular expressions to skip link checking // - replacementPatterns (optional) - An array of objects holding regular expressions for link replacements -// - baseURL (optional) - A string specifying the base URL to prefix to URLs that start with '/' +// - baseUrl (optional) - A string specifying the base URL to prefix to URLs that start with '/' // Returns: // An array of MDAST nodes that represent headings, links, link references, definitions, and image references // See https://github.com/syntax-tree/mdast for more information on the types of MDAST nodes // function extractMarkdownHyperlinks(markdownText, options = {}) { - const { ignorePatterns = [], replacementPatterns = [], baseURL } = options; + const { ignorePatterns = [], replacementPatterns = [], baseUrl } = options; const tree = unified() .use(remarkParse) .use(remarkGfm) @@ -36,8 +36,8 @@ function extractMarkdownHyperlinks(markdownText, options = {}) { } // Prefix the base URL to URLs that start with '/' - if (baseURL && url.startsWith('/')) { - url = baseURL + url; + if (baseUrl && url.startsWith('/')) { + url = baseUrl + url; } // Replace link URL based on replacement patterns diff --git a/package.json b/package.json index f2aa5f6..a0027f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@umbrelladocs/linkspector", - "version": "0.2.6", + "version": "0.2.7", "description": "Uncover broken links in your content.", "type": "module", "main": "linkspector.js",