Commit Graph
432 Commits
Author SHA1 Message Date
Guillaume Gomez 6a75867463 Merge pull request #3160 from coyaSONG/agent/playground-editable-coverage
test: cover editable playground includes
2026-09-08 15:37:28 +00:00
Guillaume Gomez 4fb9ea9bb3 Merge pull request #3141 from hollow-owl/invalid-default-theme
Invalid default-theme and preferred-dark-theme now cause an error
2026-09-07 16:47:11 +00:00
hollow-owl eab9ae4f82 Add ui test 2026-09-07 11:40:29 -05:00
VXNCXNX faa6618ab3 fix: don't highlight the first chapter when another one is the index
the sidebar treats the first chapter as an alias for index.html, but a README chapter placed later in SUMMARY.md generates index.html itself, so both entries were marked active. Skip the alias when a chapter already links to index.html. Fixes #2883.
2026-09-03 11:03:46 +00:00
Daniel Scherzer 65fae9c1b9 Prepare to rename primary branch to main 2026-09-03 12:33:15 +02:00
Guillaume Gomez 77fff93dfd Merge pull request #3191 from VXNCXNX/fix/infostring-paren-comment-3188
Stop emitting infostring comments as HTML classes
2026-09-02 19:26:48 +00:00
Guillaume Gomez f5644a5e77 Merge pull request #3163 from alexchen-sys/fix/include-path-spaces-2812
fix(links): support spaces in #include file paths
2026-09-02 16:13:52 +00:00
Guillaume Gomez dc21064fc2 Merge pull request #3198 from Chocorean/dev_2395
Use capital letters to indicate the default value in (y/n) prompts
2026-08-28 20:47:29 +00:00
Alex Chen 5fe270a0dc fix(links): emit explicit error on unclosed quoted path
Signed-off-by: Alex Chen <l46983284@gmail.com>
2026-08-28 10:45:12 +00:00
Alex Chen 4f32bbb286 fix(links): support double quotes for paths with spaces
Require double quotes for file paths containing spaces across
include, rustdoc_include, and playground directives. Preserve full
backwards compatibility for unquoted paths without spaces, and
support escaped quotes inside paths.

Signed-off-by: Alex Chen <l46983284@gmail.com>
2026-08-28 10:45:12 +00:00
Alex Chen 1e2b8f9ac7 fix(links): support spaces in #include file paths
Parse the full include/rustdoc_include target instead of splitting on
whitespace, so paths like `fila a.md` work. Line ranges still work
(`fila a.md:1:2`). Playground links keep whitespace-separated properties.

Fixes #2812.

Signed-off-by: Alex Chen <l46983284@gmail.com>
2026-08-28 10:45:12 +00:00
Noah Lev 54e4f3bf6d Merge pull request #3194 from GuillaumeGomez/zoomable-images-support
Add new `zoomable-images` config
2026-08-26 18:30:28 +00:00
Guillaume Gomez 9458fe14f1 Add new zoomable-images config 2026-08-26 20:13:44 +02:00
Chocorean b8686a21d1 Fix #2395
Improve the two yes/no prompts by capitalizing the default choice, No
2026-08-26 14:01:48 -04:00
Miikka Salminen 11368ce703 Test multiline includes in various markdown cases
Adds tests for multiline includes in the following markdown scenarios:

- Admonitions
- Admonitions nested in blockquotes
- Unordered lists
- Ordered lists

Reorganizes the existing mdBook test page for multiline includes to
accommodate the above.
2026-08-20 21:04:13 +03:00
Miikka Salminen 1335dd725c Put multiline include test expectations in file
Moves the expected testsuite page for multiline includes from the test
code string into a separate file in anticipation of additional tests for
this feature.
2026-08-20 21:02:23 +03:00
Miikka Salminen bb449a0246 Fix spelling in multiline include tests
This makes spelling in test code and test markdown related to multiline
includes consistent with other include preprocessor tests.
2026-08-20 19:17:19 +03:00
hg-anssi bae2d348a1 Support multiline includes 2026-08-20 18:42:32 +03:00
Guillaume Gomez 4a6720c8cc Merge pull request #3092 from ChrisJr404/fix/punctuation-heading-id-3002
Fall back to "section" id for punctuation-only headings
2026-08-18 19:54:00 +00:00
Chris (ChrisJr404) 6251456588 Add tests for punctuation-only and explicit-id headings
Cover the extra cases raised in review: a punctuation-only heading
that keeps counting into the section fallback (section-2/section-3)
and a punctuation-only heading with an explicit {#id} that overrides
the fallback.
2026-08-18 14:21:51 -04:00
VXNCXNX c4e2769e57 Strip every parenthesized comment, not just from the first paren
Rustdoc's grammar interleaves comments with tokens, so 'rust (why),ignore'
must keep both rust and ignore. Truncating at the first paren dropped
everything after it.
2026-08-16 06:57:07 +00:00
VXNCXNX 198f8360a6 Stop emitting infostring comments as HTML classes
Rustdoc treats everything from an opening paren as a comment, but every
token was appended as a class, so `rust,ignore (requires next solver)`
emitted a `next` class that collides with the nav rule in chrome.css.

Fixes #3188
2026-08-15 07:49:46 +00:00
VXNCXNX 6b4e15ae50 fix: point the fold chevron down in RTL books
the expanded chevron is rotated 90 degrees, which points it up once the browser has already mirrored the glyph for a right-to-left document. Rotate the other way there. Fixes #2894.
2026-08-14 21:39:13 +00:00
Matt Ickstadt 4afa69afd8 Update elasticlunr-rs to v3.1.0
This release fixes a number of panics on different inputs, and fixes
and issue which caused tokens to leak into the index of later fields:
<https://github.com/mattico/elasticlunr-rs/pull/60>

The field leak fix caused a change to the search index snapshot and an assertion.
2026-07-26 00:04:14 -05:00
coyaSONG 7911e5616f test: cover editable playground includes 2026-07-15 06:44:59 +09:00
Guillaume Gomez 588066c3d6 Make the "zoom in" feature work with keyboard and simplify DOM 2026-07-02 23:09:37 +02:00
Guillaume Gomez f526b18d6a Only enable "zoom-in" feature on images not inside links 2026-07-02 23:01:17 +02:00
Guillaume Gomez 73d6edfcaf Add possibility to "zoom out" using the escape key 2026-07-02 23:01:17 +02:00
Guillaume Gomez 6a7ef4d1c3 Add regression test for the "zoom-in" feature 2026-07-02 23:01:16 +02:00
Guillaume Gomez 71fb5a8d4a Add "zoom-in" feature on images 2026-07-02 22:58:13 +02:00
Eric Huss d9fb095f65 Update test for search::search_index_hasnt_changed_accidentally
The update of handlebars to [6.4.2](https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md#642---2026-06-24)
changed serde_json to preserve the order.
2026-07-01 17:24:04 -07:00
Guillaume Gomez 0cbf0dd60e Fix weird layout bug with images in links 2026-06-23 17:53:54 +02:00
Eric Huss 1e04de75e1 Merge pull request #3084 from tonywu6/master
Fix: Remove `?highlight=` from URL when highlights are dismissed via clicking
2026-05-13 14:15:33 +00:00
ChrisJr404 f895937f71 Fall back to "section" id for punctuation-only headings
Headings like `## ::` produce an empty id and a useless `href="#"`
because every character gets stripped by `id_from_content`. When the
slug ends up empty, return `"section"` instead so that `unique_id` can
hand out `section`, `section-1`, `section-2`, ... — matching what
pandoc and kramdown do for the same case.

Updates the existing fixture in tests/testsuite/rendering/header_links
which previously documented the broken output.

Closes #3002.
2026-05-07 07:59:10 -04:00
Eric Huss 4fb647c760 Fix global keypress handling with shadow DOM elements
This fixes an issue where global keypresses were being caught when they
shouldn't when there is a shadow DOM element with focus. This can happen
if the user has included their own extensions. Arguably the extension
should do a stopPropagation, but they don't always do that. I think this
is relatively safe way to approach this.

Fixes https://github.com/rust-lang/mdBook/issues/2507
2026-05-04 11:51:32 -07:00
Eric Huss c5c31bb9f5 Fix global keypress handler with the ACE editor
This fixes an issue where pressing `?` inside the ACE editor was opening
the help popup. The solution here is to ensure that the global keypress
handler works the same as the one used in the search handler.

Fortunately other keypresses like left and right were working OK because
ACE was doing something like stopPropagation (I'm not sure exactly).

Fixes https://github.com/rust-lang/mdBook/issues/3064
2026-05-04 11:48:41 -07:00
Tony Wu 3a16879dda Fix: Remove ?highlight= from URL when highlights are dismissed via clicking (#1841) 2026-05-01 10:55:51 +08:00
Eric Huss 4adc4b08ba Add a test for global keypress with ACE editor focused
This is a regression test for
https://github.com/rust-lang/mdBook/issues/3064.
2026-04-27 15:32:09 -07:00
Eric Huss 22f3035df0 Add a test for global keypress with shadow-dom elements
This is a regression test for
https://github.com/rust-lang/mdBook/issues/2507.
2026-04-27 15:31:04 -07:00
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
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
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
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 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 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 5d64d0e5f2 Merge pull request #2953 from ehuss/fix-heading-nav-level
Fix heading nav level
2025-11-20 01:13:35 +00:00
Eric Huss 718ceecfa2 Fix heading nav depth
This fixes an issue where when a heading goes from a larger to a smaller
level, it was going back too far so that subsequent headings would be at
a lower level than they should have been.

Fixes https://github.com/rust-lang/mdBook/issues/2944
2025-11-19 17:06:49 -08:00