fix: do not cut kbd in tooltip

Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
Yohan Boniface 2025-04-07 18:22:34 +02:00
parent 55babfde34
commit e1272ec6cd
3 changed files with 6 additions and 1 deletions

View file

@ -203,6 +203,10 @@ dt {
/* Various */ /* Various */
/* *********** */ /* *********** */
.nobr {
white-space: nowrap;
}
.text { .text {
word-break: break-word; word-break: break-word;
white-space: pre-line; white-space: pre-line;

View file

@ -196,7 +196,7 @@ export default class Help {
.split('+') .split('+')
.map((el) => `<kbd>${el}</kbd>`) .map((el) => `<kbd>${el}</kbd>`)
.join('+') .join('+')
label += ` ${shortcut}` label += ` <span class="nobr">${shortcut}</span>`
} else { } else {
label += ` (${shortcut})` label += ` (${shortcut})`
} }

View file

@ -126,6 +126,7 @@ export function escapeHTML(s) {
'frameborder', 'frameborder',
'scrolling', 'scrolling',
'controls', 'controls',
'class',
], ],
ALLOWED_ATTR: ['href', 'src', 'width', 'height', 'style', 'dir', 'title', 'type'], ALLOWED_ATTR: ['href', 'src', 'width', 'height', 'style', 'dir', 'title', 'type'],
// Added: `geo:` URL scheme as defined in RFC5870: // Added: `geo:` URL scheme as defined in RFC5870: