sphinx
sphinx copied to clipboard
Fix inconsistent splitting of multi-word key names
This PR fixes a typo in the KeyboardTransform logic for :kbd: roles.
Feature or Bugfix
- [ ] ~~Feature~~
- [x] Bugfix
- [ ] ~~Refactoring~~
Purpose
Each of the following lines yields a different HTML tree:
:kbd:`page down`
:kbd:`page up`
Output:
<kbd class="kbd compound docutils literal notranslate">
<kbd class="kbd docutils literal notranslate">page</kbd>
<kbd class="kbd docutils literal notranslate">down</kbd>
</kbd>
<kbd class="kbd docutils literal notranslate">page up</kbd>
The fault is a few missing commas, which appears to be an honest typo. Nevertheless, I still added a regression test for it.