From e1272ec6cdc7f52488293e49a6b733179350532e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 7 Apr 2025 18:22:34 +0200 Subject: [PATCH] fix: do not cut kbd in tooltip Co-authored-by: David Larlet --- umap/static/umap/base.css | 4 ++++ umap/static/umap/js/modules/help.js | 2 +- umap/static/umap/js/modules/utils.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index cb926b15..2dd6d941 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -203,6 +203,10 @@ dt { /* Various */ /* *********** */ +.nobr { + white-space: nowrap; +} + .text { word-break: break-word; white-space: pre-line; diff --git a/umap/static/umap/js/modules/help.js b/umap/static/umap/js/modules/help.js index c5c2fbad..4363e6cf 100644 --- a/umap/static/umap/js/modules/help.js +++ b/umap/static/umap/js/modules/help.js @@ -196,7 +196,7 @@ export default class Help { .split('+') .map((el) => `${el}`) .join('+') - label += ` ${shortcut}` + label += ` ${shortcut}` } else { label += ` (${shortcut})` } diff --git a/umap/static/umap/js/modules/utils.js b/umap/static/umap/js/modules/utils.js index 17994485..625674da 100644 --- a/umap/static/umap/js/modules/utils.js +++ b/umap/static/umap/js/modules/utils.js @@ -126,6 +126,7 @@ export function escapeHTML(s) { 'frameborder', 'scrolling', 'controls', + 'class', ], ALLOWED_ATTR: ['href', 'src', 'width', 'height', 'style', 'dir', 'title', 'type'], // Added: `geo:` URL scheme as defined in RFC5870: