Skip to content

Bug: relative links to 'README.md' files don't resolve #1920

@chrstnst

Description

@chrstnst

Linking to other markdown files in the book's source generally works as expected. The exception are links to 'README.md' files. Clicking on such links in the HTML version of the book results in a 404 (Document not found) error.

Steps to reproduce:

  1. Create a book's source as follows:

    src/book.toml:

    [book]
    authors = []
    language = "en"
    multilingual = false
    src = "src"

    src/SUMMARY.md:

    # Summary
    
    - [Chapter 1](./chapter_1/README.md)
    - [Chapter 2](./chapter_2/README.md)
        - [Chapter 2.1](./chapter_2/chapter_2.1.md)

    src/chapter_1/README.md:

    # Chapter 1
    
    - Link to [Chapter 2](../chapter_2/README.md)
    - Link to [Chapter 2.1](../chapter_2/chapter_2.1.md)

    src/chapter_2/README.md:

    # Chapter 2

    src/chapter_2/chapter_2.1.md:

    # Chapter 2.1
  2. Build and serve the book: mdbook serve

  3. Open the book in your browser: http://localhost:3000

  4. Click on the links in Chapter 1: while the link to Chapter 2.1 works fine, the link to Chapter 2 doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions