Commit graph

6 commits

Author SHA1 Message Date
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
Eric Huss
189eea5beb Update eslint to 9.34.0
This requires a switch to the configuration file format described at
https://eslint.org/docs/latest/use/configure/configuration-files. I used
the automatic tool to generate the new file, with some simplifications
around defaults.

- Removed no-cond-assign override, it is no longer needed.
- Fixed `catch (e)` where `e` is not used. This seems a little pedantic
  to me, but seems like a relatively easy fix to just remove it, and I
  believe the syntax without the variable has been supported for quite
  some time. Alternatively it could also be `_e`, or explicitly allowed.
- Added `--no-warn-ignored` to the script since it was very noisy.
2025-08-25 14:29:00 -07:00
Eric Huss
402d11414c Change all HTML IDs to have a prefix
This changes all HTML IDs so that they have the `mdbook-` prefix. This
should help avoid ID conflicts between internal IDs and IDs from user
content such as section headers.

This is a relatively disruptive change and has a high risk of breaking
something. However, I think I have covered everything, and if anything
is missed, hopefully it will get detected.

I did not change class names since the chance of a collision is much
smaller than with IDs. However, that is something that could be
considered in the future.

Closes https://github.com/rust-lang/mdBook/issues/880
2025-08-19 19:38:22 -07:00
Michael Howell
2dc8c5e686 Use embedded SVG instead of fonts for icons
The [downsides of icon fonts] are well-documented, and also, why ship all of
the icons when it only uses 14?

[downsides of icon fonts]: https://speakerdeck.com/ninjanails/death-to-icon-fonts
2025-08-14 20:14:55 -07:00
Eric Huss
3087686559 Move theme to mdbook-html
This is a pure git rename in order to make sure that git can follow
history. The next commit will integrate these into mdbook-html.
Additional commits will refactor/move/remove items.
2025-07-23 17:40:52 -07:00
Renamed from src/front-end/js/book.js (Browse further)