When an invalid Font Awesome icon name is used (e.g. in git-repository-icon),
the error message now includes the icon name, the type that was searched,
valid prefix options (fas/fab/far), and a link to the FontAwesome icon gallery.
Before: Missing font github
After: Unknown Font Awesome icon `github` for type `regular`. Hint: check
the icon name and prefix (fas (solid), fab (brands), or far (regular))
at https://fontawesome.com/v6/search?m=freeFixes#3023
These dependencies of the top-level `mdbook` package are not directly
used. They are used transitively, so this makes little difference, but
helps to convey what is actually needed.
Use child combinator (>) instead of descendant selector for
blockquote-tag-title color rules. Without this, a nested admonition
inherits the title color of its parent admonition instead of using
its own type's color.
Added nested admonition test case (important > note) to the existing
admonition test suite.
Fixes#3032
This fixes an issue where `mdbook serve` would repeatedly show an error
message every second if the `output.html` config had a problem. The
issue is that `set_roots` was doing more work than I realized. It is not
necessary to call it every time in the main polling loop, since the
roots only change when the book configuration changes.
The solution is to just reset the roots whenever the book config
changes.
Fixes https://github.com/rust-lang/mdBook/issues/2946
This fixes an issue where the sidebar was scrolling incorrectly when
clicking on chapters when a heading nav is currently in view. The
problem was that it was storing the scrollTop of the sidebar, but it was
not considering that when navigating to another chapter that the heading
nav of the previous chapter would disappear.
The solution is to keep of an offset instead so that it can make sure
that the vertical position of the clicked chapter stays in the same
relative position when the new page loads.
Fixes https://github.com/rust-lang/mdBook/issues/2967
Due to a change in tracing-subscriber where it escapes ANSI codes, the
output from rustdoc was changed to be escaped instead of colored. This
fixes the issue by just printing to the console directly.
This does not have a test because it is difficult to emulate a terminal
in the testsuite, and I don't feel like adding color overrides at the
moment.
Ref:
- https://github.com/rust-lang/mdBook/pull/2829 -- Switched to tracing
- https://github.com/advisories/GHSA-xwfj-jgwm-7wp5 -- CVE-2025-58160
- https://github.com/tokio-rs/tracing/issues/3378 -- Discussion of
supporting color codes.
Eventually mdbook's primary output should migrate away from using log
messages, and instead use a structured console system. However, that's a
ways off.
This fixes a problem where custom preprocessors were not being
registered when running tests. This was caused by the test function
rebuilding the preprocessor map.
This removes the code that was rebuilding the preprocessors and removing
the IndexPreprocessor when running tests. Skipping IndexPreprocessor was
added back in https://github.com/rust-lang/mdBook/pull/741 to fix
https://github.com/rust-lang/mdBook/issues/724 which was caused by
https://github.com/rust-lang/mdBook/pull/685 which added the
IndexPreprocessor.
Additionally, https://github.com/rust-lang/mdBook/pull/1986 added
running *all* preprocessors.
The IndexPreprocessor was removed because in the past the code was
testing against the source directly, and the path from `chapter.path` is
the converted `index.md` file, and that filename does not exist in the
source. This isn't a problem anymore because due to
https://github.com/rust-lang/mdBook/pull/891 it is not reading from the
`src` directory.
Note that this results in a minor change where the chapter path changes
from `README.md` to `index.md` in the output and the `--chapter` option.
I think I'm ok with that change, though it would be easy to switch it
back if that's an issue.