Commit graph

3135 commits

Author SHA1 Message Date
Eric Huss
dc2fbde515 Harden move-between-pages and sidebar-scroll tests
These tests have been randomly failing on CI. I'm not entirely certain
why there is a race for these conditions. I'm not sure how
browser-ui-test waits when the document reloads on navigation.

There's also some javascript triggers that happen after the page loads,
and I don't remember if that runs before DOMContentLoaded.
2026-04-20 17:16:16 -07:00
Eric Huss
c4efaffc1d Try to make heading-nav-collapsed test more reliable
This test seems to be a little flaky. This tries to make it more
reliable by using `wait-for-` commands instead of `assert-`. My guess is
that clicking on an element doesn't necessarily wait for all the
javascript code to finish and the DOM to be done updating.
2026-04-20 17:07:56 -07:00
Eric Huss
05fbc5d3d0
Merge pull request #3052 from jhult/fix/gui-sidebar-scroll-failure
fix(gui): use class selectors for sidebar-scrollbox in GUI tests
2026-03-23 22:00:22 +00:00
Jonathan Hult
edf704aa4d
fix(gui): use class selectors for sidebar-scrollbox in GUI tests
Fixes CI failure in sidebar-scroll.goml where mdbook-sidebar-scrollbox custom element not found (timing issue in headless Linux Chrome). The class is always present in generated HTML (<mdbook-sidebar-scrollbox class="sidebar-scrollbox">).
2026-03-16 14:17:54 -05:00
Eric Huss
30e0e1d102
Merge pull request #3048 from rust-lang/renovate/cargo-semver-checks-0.x
chore(deps): update cargo-semver-checks to v0.47.0
2026-03-09 15:34:21 +00:00
renovate[bot]
04e3e2a2fa
chore(deps): update cargo-semver-checks to v0.47.0 2026-03-08 16:46:53 +00:00
Eric Huss
891e203410
Merge pull request #3042 from rust-lang/update-dependencies
Update cargo dependencies
2026-03-01 22:53:51 +00:00
Eric Huss
05badb1e2d Update cargo dependencies
```
name           old req compatible latest  new req
====           ======= ========== ======  =======
anyhow         1.0.100 1.0.102    1.0.102 1.0.102
clap           4.5.56  4.5.60     4.5.60  4.5.60
clap_complete  4.5.65  4.5.66     4.5.66  4.5.66
futures-util   0.3.31  0.3.32     0.3.32  0.3.32
memchr         2.7.6   2.8.0      2.8.0   2.8.0
pulldown-cmark 0.13.0  0.13.1     0.13.1  0.13.1
regex          1.12.2  1.12.3     1.12.3  1.12.3
tempfile       3.24.0  3.26.0     3.26.0  3.26.0
toml           1.0.0   1.0.3      1.0.3   1.0.3
```
2026-03-01 14:46:03 -08:00
Eric Huss
31e5c1e6d5
Merge pull request #3045 from rust-lang/renovate/toml-1.x
chore(deps): update rust crate toml to v1
2026-03-01 22:13:27 +00:00
Eric Huss
db74eec5b2
Merge pull request #3043 from rust-lang/renovate/eslint-10.x
chore(deps): update dependency eslint to v10
2026-03-01 21:41:11 +00:00
Eric Huss
59ec865810
Merge pull request #3044 from rust-lang/renovate/snapbox-1.x
chore(deps): update rust crate snapbox to v1
2026-03-01 21:39:41 +00:00
renovate[bot]
f0d9591bb9
chore(deps): update rust crate toml to v1 2026-03-01 00:46:18 +00:00
renovate[bot]
1b61b0b941
chore(deps): update rust crate snapbox to v1 2026-03-01 00:46:11 +00:00
renovate[bot]
44a3420551
chore(deps): update dependency eslint to v10 2026-03-01 00:45:13 +00:00
Eric Huss
33f76c0a30
Merge pull request #3037 from cobyfrombrooklyn-bot/fix-issue-3023
Fix #3023: Improve error message for invalid Font Awesome icons
2026-02-27 14:13:02 +00:00
cobyfrombrooklyn-bot
d171e698fa Improve error message for invalid Font Awesome icons
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=free

Fixes #3023
2026-02-24 08:58:05 -05:00
Eric Huss
424d6a4dbd
Merge pull request #3036 from ehuss/remove-unused
Remove unused dependencies
2026-02-23 15:26:18 +00:00
Eric Huss
b2e952dd4c Remove unused dependencies
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.
2026-02-23 07:20:41 -08:00
Eric Huss
0e6c5d0b8a
Merge pull request #3035 from cobyfrombrooklyn-bot/fix-issue-3032
Fix #3032: Nested admonitions use wrong header colors
2026-02-23 15:07:34 +00:00
cobyfrombrooklyn-bot
6d0ba2ac14 Fix nested admonitions using wrong header color
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
2026-02-22 20:44:05 -05:00
Eric Huss
b8c90970a6
Merge pull request #3022 from rust-lang/dependabot/cargo/bytes-1.11.1
Bump bytes from 1.11.0 to 1.11.1
2026-02-04 00:30:53 +00:00
dependabot[bot]
4d9ff03cbd
Bump bytes from 1.11.0 to 1.11.1
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-version: 1.11.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-03 19:44:25 +00:00
Eric Huss
ec2b103e78
Merge pull request #3017 from rust-lang/renovate/ego-tree-0.x
chore(deps): update rust crate ego-tree to 0.11.0
2026-02-01 03:00:13 +00:00
Eric Huss
a3550f99a5
Merge pull request #3018 from rust-lang/renovate/html5ever-0.x
chore(deps): update rust crate html5ever to 0.38.0
2026-02-01 03:00:11 +00:00
renovate[bot]
c5fc1542ee
chore(deps): update rust crate html5ever to 0.38.0 2026-02-01 02:23:00 +00:00
renovate[bot]
13c560f478
chore(deps): update rust crate ego-tree to 0.11.0 2026-02-01 02:22:56 +00:00
Eric Huss
2e1b749ccd
Merge pull request #3019 from rust-lang/update-dependencies
Update cargo dependencies
2026-02-01 02:15:46 +00:00
Eric Huss
d7c9ab1334
Merge pull request #3016 from rust-lang/renovate/browser-ui-test-0.x
chore(deps): update dependency browser-ui-test to v0.23.3
2026-02-01 02:14:39 +00:00
github-actions[bot]
f2eb07292a Update cargo dependencies
```
name          old req compatible latest  new req
====          ======= ========== ======  =======
clap          4.5.53  4.5.56     4.5.56  4.5.56
clap_complete 4.5.64  4.5.65     4.5.65  4.5.65
handlebars    6.3.2   6.4.0      6.4.0   6.4.0
indexmap      2.12.1  2.13.0     2.13.0  2.13.0
opener        0.8.3   0.8.4      0.8.4   0.8.4
serde_json    1.0.148 1.0.149    1.0.149 1.0.149
snapbox       0.6.23  0.6.24     0.6.24  0.6.24
tokio         1.48.0  1.49.0     1.49.0  1.49.0
toml          0.9.10  0.9.11     0.9.11  0.9.11
```
2026-02-01 00:45:42 +00:00
renovate[bot]
c7743f8645
chore(deps): update dependency browser-ui-test to v0.23.3 2026-02-01 00:35:08 +00:00
Eric Huss
72d2ba722e
Merge pull request #3010 from rust-lang/renovate/cargo-semver-checks-0.x
chore(deps): update cargo-semver-checks to v0.46.0
2026-01-23 17:58:37 +00:00
renovate[bot]
1b58485dae
chore(deps): update cargo-semver-checks to v0.46.0 2026-01-23 08:44:45 +00:00
Eric Huss
cc78fb4ff1
Merge pull request #2998 from rust-lang/renovate/pulldown-cmark-to-cmark-22.x
chore(deps): update rust crate pulldown-cmark-to-cmark to v22
2026-01-01 16:11:10 +00:00
Eric Huss
1bd97f8e0e
Merge pull request #2996 from rust-lang/update-dependencies
Update cargo dependencies
2026-01-01 16:08:59 +00:00
renovate[bot]
02dc23a73d
chore(deps): update rust crate pulldown-cmark-to-cmark to v22 2026-01-01 00:38:01 +00:00
github-actions[bot]
1d08190aca Update cargo dependencies
```
name          old req compatible latest  new req
====          ======= ========== ======  =======
axum          0.8.7   0.8.8      0.8.8   0.8.8
clap_complete 4.5.61  4.5.64     4.5.64  4.5.64
html5ever     0.36.0  0.36.1     0.36.1  0.36.1
serde_json    1.0.145 1.0.148    1.0.148 1.0.148
tempfile      3.23.0  3.24.0     3.24.0  3.24.0
toml          0.9.8   0.9.10     0.9.10  0.9.10
tower-http    0.6.7   0.6.8      0.6.8   0.6.8
tracing       0.1.43  0.1.44     0.1.44  0.1.44
name                    old req compatible latest new req note
====                    ======= ========== ====== ======= ====
pulldown-cmark-to-cmark 21.0.0  21.1.0     22.0.0 21.1.0  incompatible
```
2026-01-01 00:36:42 +00:00
Eric Huss
7b29f8a717
Merge pull request #2985 from ehuss/bump-version
Update to 0.5.2
2025-12-11 19:47:18 +00:00
Eric Huss
94569a42da Update to 0.5.2 2025-12-11 11:40:27 -08:00
Eric Huss
97747621aa
Merge pull request #2983 from ehuss/serve-bad-html-config
serve: Fix repeated error message when HTML config is invalid
2025-12-11 19:39:16 +00:00
Eric Huss
723d9df6c7 serve: Fix repeated error message when HTML config is invalid
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
2025-12-11 11:22:16 -08:00
Eric Huss
45e2158e84
Merge pull request #2982 from ehuss/fix-sidebar-scroll
Fix sidebar scroll position when heading nav is involved
2025-12-11 19:21:21 +00:00
Eric Huss
59017ea918 Fix sidebar scroll position when heading nav is involved
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
2025-12-11 11:13:47 -08:00
Eric Huss
f857ab294c
Merge pull request #2981 from ehuss/fix-rustdoc-color
Fix color for rustdoc error messages
2025-12-10 22:08:16 +00:00
Eric Huss
938a9126b0
Merge pull request #2980 from ehuss/fix-test-preprocessor
Don't rebuild preprocessor map during test
2025-12-10 22:03:08 +00:00
Eric Huss
23724b0a6b Fix color for rustdoc error messages
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.
2025-12-10 14:01:50 -08:00
Eric Huss
7bdea7c085 Don't rebuild preprocessor map during test
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.
2025-12-10 13:42:15 -08:00
Eric Huss
2bcae6b0a9 Add a test with a custom preprocessor
This test illustrates that the test function is not working correctly
when there is a custom preprocessor.
2025-12-10 12:51:19 -08:00
Eric Huss
6457b381d8
Merge pull request #2973 from LucasPickering/patch-1
Fix link for parse_input() in preprocessors.md
2025-12-02 00:15:15 +00:00
Lucas Pickering
9eb6fe0483
Fix link for parse_input() in preprocessors.md
This doc still referenced `CmdPreprocessor::parse_input`, which was removed in 0.5. Now it's just `mdbook_preprocessor::parse_input`.
2025-12-01 18:40:55 -05:00
Eric Huss
674733864f
Merge pull request #2970 from rust-lang/renovate/html5ever-0.x
Update Rust crate html5ever to 0.36.0
2025-12-01 18:37:46 +00:00