diff --git a/README.md b/README.md index ee16ccc..c102993 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ To check all the links within a live web page, skipping over internal links: curl https://test.com | sed -n 's/.*href="\(h[^"]*\).*/\1/p' | coroner -s test.com ``` +Check all links within markdown files in a folder or its subfolders recursively: + +``` +find . -name "*.md" -not \( -name .svn -prune -o -name .git -prune \) -type f -print0 | xargs -0 sed -n 's/.*(\(http[^)]*\).*/\1/p' | coroner +``` + ## Options Options are: diff --git a/package.json b/package.json index 37b081a..534f0ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coroner", - "version": "1.0.5", + "version": "1.0.6", "type": "commonjs", "exports": "./index.js", "description": "more useful dead link detection", diff --git a/tests.js b/tests.js index 0f77216..5b179ea 100644 --- a/tests.js +++ b/tests.js @@ -160,11 +160,11 @@ const tests = [ statusCodes: [200, 304], name: 'validHTML', // Check the response body looks like a valid HTML document test: (input, options, response, responseText) => - !responseText.slice(0, 30).trim().toLowerCase().startsWith(" "Does not look like a valid HTML file: first characters are " + responseText.slice(0, 60).trim().toLowerCase() + !responseText.slice(0, 100).trim().toLowerCase().startsWith(" "Does not look like a valid HTML file: first characters are '" + responseText.slice(0, 60).trim().toLowerCase() + "'" }, { phase: 'post',