Skip to content

Conversation

brechtm
Copy link
Contributor

@brechtm brechtm commented Sep 5, 2025

See #13876: Regression: :kbd: in Sphinx 8.2

@AA-Turner
Copy link
Member

Test failures seem related. Please also add a CHANGES entry.

@brechtm brechtm force-pushed the fix-kbd-regression-13876 branch from 7c2c65e to 8781d36 Compare September 5, 2025 21:12
@brechtm
Copy link
Contributor Author

brechtm commented Sep 8, 2025

Test failures seem related. Please also add a CHANGES entry.

Fixed and done!

Not sure you got notified of my new commits, so here's a friendly nudge 🙂

@AA-Turner
Copy link
Member

@brechtm I've updated this so that the wrapper element is only inserted for groups of <kbd> elements, what do you think?

This restores previous behaviour mistakenly removed in #13227, HTML tags previously had .kbd.compound classes.

A

@brechtm
Copy link
Contributor Author

brechtm commented Oct 10, 2025

@brechtm I've updated this so that the wrapper element is only inserted for groups of <kbd> elements, what do you think?

Mmm, this makes things less consistent, I think. The wrapper element could be used to style the entire keyboard shortcut, whether it consists of a single keypress or a combination. Note that the wrapper does not affect the styling of a single <kbd> elements if no style is defined for it.

@AA-Turner
Copy link
Member

@brechtm yes, though I'd argue also clearer semantics. A nested <kbd> with only one child key is quite odd, there are no examples of it on MDN.

If your problem is CSS, would it work to adjust the classes in some fashion?

A

@brechtm
Copy link
Contributor Author

brechtm commented Oct 11, 2025

Oops, I was mixing up the docutils doctree and the HTML representation. My primary concern is the rinohtype implementation, of course.

I think it makes sense that the docutils tree for this would consistently have the outer (compound) level, even if there's only a single child element inside. The HTML writer can always remove it when there is only a single child element, even though it could be useful to have the outer <kbd> present at all times there too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants