Component: DMD, DDoc
OS: Ubuntu Linux 20.04.03 LTS
Summary: When generating documentation via `dub build -b docs`, DDoc comments using relative links, project symbols in [square brackets], result in invalid links. These invalid links include the base document dir `/docs` twice, e.g. `/docs/docs`.
Environment: DMD v2.098.1
Reproduction Steps:
1. Create a simple project with relative links, e.g.:
```d
// File: source/avro/parser.d
module avro.parser;
class Parser {
/// Builds a [Schema] using a path to a ".avsc" file.
public Schema parseFile(string fileName) {
}
}
// File: source/avro/schema.d
module avro.schema;
class Schema {
}
```
2. Build the project documentation via `dub build -b docs`.
3. Browse to the generated documentation for parser, e.g. `file:///home/vnayar/projects/avro-d/docs/parser.html`.
4. Navigate to the documentation for the `parseFile` method, and click on the `Schema` link.
Observed Behavior: The link is invalid because it contains `/docs` twice, e.g. `file:///home/vnayar/projects/avro-d/docs/docs/schema.html#Schema`
Expected Behavior: The link should only include the document root once, e.g. `file:///home/vnayar/projects/avro-d/docs/schema.html#Schema`.
Comment #1 by robert.schadek — 2024-12-13T19:21:04Z