1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

Utilities: Resolve manpage paths more robustly in markdown-check

The path is now relative to the Serenity source directory, and later
parts of the URL path are not simply discarded. This allows links into
subsection man pages to be checked correctly.
This commit is contained in:
kleines Filmröllchen 2022-12-14 15:48:19 +01:00 committed by Andrew Kaster
parent 44e4a38535
commit a676cf658b

View file

@ -196,7 +196,9 @@ RecursionDecision MarkdownLinkage::visit(Markdown::Text::LinkNode const& link_no
m_has_invalid_link = true;
return RecursionDecision::Recurse;
}
auto file = DeprecatedString::formatted("../man{}/{}.md", url.paths()[0], url.paths()[1]);
// Remove leading '/' from the path.
auto file = DeprecatedString::formatted("{}/Base/usr/share/man/man{}.md", m_serenity_source_directory, url.path().substring(1));
m_file_links.append({ file, DeprecatedString(), StringCollector::from(*link_node.text) });
return RecursionDecision::Recurse;