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:
parent
44e4a38535
commit
a676cf658b
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue