sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Fix inconsistent splitting of multi-word key names

Open Alhadis opened this issue 3 years ago • 0 comments

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.

Alhadis avatar Aug 13 '22 13:08 Alhadis