diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-03-19 13:15:57 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-03-19 13:25:08 -0300 |
| commit | aa8a28f7981955f75c8c5e75f6c67579de2ca712 (patch) | |
| tree | 1ae0f581fb90c2fc8671b56fd20947014096bfa8 /src/content/dependencies/transformContent.js | |
| parent | f0ad070a65cb3ff0fe800a06891654a01190c5d5 (diff) | |
content: generateTextWithTooltip, etc: keyboard focus
Diffstat (limited to 'src/content/dependencies/transformContent.js')
| -rw-r--r-- | src/content/dependencies/transformContent.js | 19 |
1 files changed, 11 insertions, 8 deletions
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}; } |