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.
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>
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>
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.
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.
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.
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.
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
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.
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.
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.
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
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
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.
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.
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">).
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
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 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
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.
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