Skip to content

Instantly share code, notes, and snippets.

@andreich1980
andreich1980 / check-anchors.php
Last active November 28, 2020 13:44
Script that helps to detect broken links in md files (specifically - laravel/docs)
<?php
/**
* Parses *.md files in the current directory for broken links.
* - [Link](#broken-anchor) without <a name="broken-anchor"></a> within the same file
* - [Link](another-file#broken-anchor) without <a name="broken-anchor"></a> in the another-file.md
*/
$ok = $fail = 0;