From aa8a28f7981955f75c8c5e75f6c67579de2ca712 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 19 Mar 2026 13:15:57 -0300 Subject: content: generateTextWithTooltip, etc: keyboard focus --- src/content/dependencies/transformContent.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/content/dependencies/transformContent.js') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index fa7f2e88..775ccfdc 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -715,6 +715,7 @@ export default { if (externalLink) { externalLink.setSlots({ content: label, + attributes: {class: 'text-with-tooltip-interaction-cue'}, fromContent: true, }); @@ -736,15 +737,17 @@ export default { content: tooltipContent, // Not sanitized! }); - textWithTooltip.setSlots({ - attributes: [ - {class: 'content-tooltip-guy'}, - externalLink && {class: 'has-link'}, - ], + const attributes = html.attributes(); + attributes.add('class', 'content-tooltip-guy'); - text: externalLink ?? label, - tooltip, - }); + if (externalLink) { + attributes.add('class', 'has-link'); + textWithTooltip.setSlot('text', externalLink); + } else { + textWithTooltip.setSlot('text', label); + } + + textWithTooltip.setSlots({attributes, tooltip}); return {type: 'processed-tooltip', data: textWithTooltip}; } -- cgit 1.3.0-6-gf8a5