Skip to content

Commit 92a1c6d

Browse files
NetdocsCopilot
andcommitted
docs(link-notes): use ad-blocker-safe class names in tooltip example
Rename the tooltip-mode example classes from affiliate-*/tooltip-* to a neutral buylink-* prefix and add a warning: ad-blocker cosmetic filters (e.g. [class*="affiliate"]{display:none}) will hide the whole link for many readers while it renders fine in a clean browser. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4d8adbb commit 92a1c6d

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

docs-site/docs/plugins/link-notes.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,25 @@ footnotes at all). The snippet receives the matched link as template parameters,
128128
A `link_snippet` is typically a small HTML fragment that wraps the link with a CSS-styled tooltip:
129129

130130
```html
131-
<span class="affiliate-wrapper"><a href="${url}" target="_blank" rel="nofollow sponsored noopener"
132-
class="affiliate-link">${text}</a><span class="affiliate-tooltip"><span class="tooltip-title">eBay
133-
Affiliate Link</span><span class="tooltip-content">This is an eBay affiliate link…</span></span></span>
131+
<span class="buylink-wrap"><a href="${url}" target="_blank" rel="nofollow sponsored noopener"
132+
class="buylink-a">${text}</a><span class="buylink-pop"><span class="buylink-pop-h">eBay
133+
Affiliate Link</span><span class="buylink-pop-b">This is an eBay affiliate link…</span></span></span>
134134
```
135135

136136
Because the replacement is inline HTML (not a footnote), tooltip mode also works **inside pipe-table
137137
cells** — where footnote references can't go — so links generated from CSVs by the
138138
[table-reader](table-reader.md) get the same pretty popup. A referenced-but-missing `link_snippet`
139139
**fails the build**, exactly like `note_snippet`.
140140

141+
!!! warning "Avoid ad-blocker-triggering class names"
142+
Don't put the word `affiliate` (or `sponsor`/`ad`/`promo`) in the class names. Ad-blockers ship
143+
cosmetic filters such as `[class*="affiliate"] { display: none }`, which will **hide the whole
144+
link** for a large share of readers while it still renders fine in a clean browser. Use a neutral
145+
prefix (the example above uses `buylink-*`).
146+
141147
!!! tip "Style it once"
142-
Put the tooltip CSS (`.affiliate-wrapper` / `.affiliate-tooltip` etc.) in your `extra_css` and
143-
reuse the same classes across every affiliate snippet so all popups look consistent.
148+
Put the tooltip CSS (`.buylink-wrap` / `.buylink-pop` etc.) in your `extra_css` and
149+
reuse the same classes across every snippet so all popups look consistent.
144150

145151
## How it works
146152

0 commit comments

Comments
 (0)