Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the SUMMARY.md parser too flexible? #2588

Open
szabgab opened this issue Mar 9, 2025 · 0 comments
Open

Is the SUMMARY.md parser too flexible? #2588

szabgab opened this issue Mar 9, 2025 · 0 comments
Labels
A-Summary Area: The summary page, organization of pages. C-question Category: A question on how to do something

Comments

@szabgab
Copy link
Contributor

szabgab commented Mar 9, 2025

Question

I was trying to create a test for the Summary parsing failed error in book.rs, but so far it parsed everything.
Sometimes not as I expected, but I could not create a SUMMARY.md file that would fail to parse.

Here is one thing that seems to be odd. These example all generate the same thing (two prefix chapters)

Both starting on the 1st column

[A](./a.md)
[B](./b.md)

B Starting indented (the

[A](./a.md)
  [B](./b.md)
[A](./a.md) [B](./b.md)

Even when there are 1-3 leading spaces

  [A](./a.md) [B](./b.md)

However, when there are 4 leading spaces, then these entries are disregarded

    [A](./a.md) [B](./b.md)

This is also accepted:

[A](./a.md)
- [B](./b.md)
[C](./c.md)
- [D](./d.md)
[E](./e.md)

My understanding of the docs is that you cannot have a prefix (like) chapter after the first numbered chapter.

The result is

A
1. B
2. D

without error.

IMHO mdbook should have stricter rules and it should report errors instead of just disregarding things.

Version

0.4.46
@szabgab szabgab added the C-question Category: A question on how to do something label Mar 9, 2025
@ehuss ehuss added the A-Summary Area: The summary page, organization of pages. label Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Summary Area: The summary page, organization of pages. C-question Category: A question on how to do something
Projects
None yet
Development

No branches or pull requests

2 participants