diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2023-01-07 17:05:33 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-08 13:35:29 +0100 |
commit | f4b95835d11252140ea1c44fcda055e56355c7d6 (patch) | |
tree | 6bb208a47accefa6fe850515fd80bac702bcec9d /Userland | |
parent | e430667923cabbf2b95821d3654eeec0d65392f5 (diff) | |
download | serenity-f4b95835d11252140ea1c44fcda055e56355c7d6.zip |
markdown-check: Check that no old-style inter-manpage links are used
We've had quite some instances of people reintroducing these kinds of
links because they didn't know about the "new" help:// scheme. This
check should now prevent that from happening, though it might in rare
circumstances trigger a false positive.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/markdown-check.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Utilities/markdown-check.cpp b/Userland/Utilities/markdown-check.cpp index fe93b0e865..0a681eac01 100644 --- a/Userland/Utilities/markdown-check.cpp +++ b/Userland/Utilities/markdown-check.cpp @@ -204,6 +204,11 @@ RecursionDecision MarkdownLinkage::visit(Markdown::Text::LinkNode const& link_no return RecursionDecision::Recurse; } if (url.scheme() == "file") { + if (url.path().contains("man"sv) && url.path().ends_with(".md"sv)) { + warnln("Inter-manpage link without the help:// scheme: {}\nPlease use help URLs of the form 'help://man/<section>/<subsection...>/<page>'", href); + m_has_invalid_link = true; + return RecursionDecision::Recurse; + } // TODO: Check more possible links other than icons. if (url.path().starts_with("/res/icons/"sv)) { auto file = DeprecatedString::formatted("{}/Base{}", m_serenity_source_directory, url.path()); |