Skip to content

Commit 55e5e7a

Browse files
authored
Tweak tooltip to remove whitespace. (#29990)
1 parent 68523fc commit 55e5e7a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

layouts/shortcodes/tooltip.html

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,5 @@
4646
{{- $displayText = upper $displayText -}}
4747
{{- end -}}
4848

49-
<!-- Render tooltip -->
50-
{{- if or $shortDefMatch (and $text $tooltip) -}}
51-
<span class="tooltip-container">
52-
<button class="tooltip-trigger" aria-describedby="tooltip-{{- $displayText | anchorize -}}">{{- $displayText -}}</button>
53-
<span id="tooltip-{{- $displayText | anchorize -}}" class="tooltip-content" role="tooltip">
54-
{{- $tooltipContent | safeHTML -}}{{- if $fullDefinitionLink -}}<a href="{{- $fullDefinitionLink -}}" class="tooltip-full-link" aria-label="View full definition">Glossary</a>{{- end -}}
55-
</span>
56-
</span>
57-
{{- else -}}
58-
{{- $displayText -}}
59-
{{- end -}}
49+
<!-- Render tooltip (on one line to prevent unnecessary whitespace around tooltip) -->
50+
{{- if or $shortDefMatch (and $text $tooltip) -}}<span class="tooltip-container"><button class="tooltip-trigger" aria-describedby="tooltip-{{- $displayText | anchorize -}}">{{- $displayText -}}</button><span id="tooltip-{{- $displayText | anchorize -}}" class="tooltip-content" role="tooltip">{{- $tooltipContent | safeHTML -}}{{- if $fullDefinitionLink -}}<a href="{{- $fullDefinitionLink -}}" class="tooltip-full-link" aria-label="View full definition">Glossary</a>{{- end -}}</span></span>{{- else -}}{{- $displayText -}}{{- end -}}

0 commit comments

Comments
 (0)