Skip to content

Commit 80e75a4

Browse files
authored
fix(plugin-twoslash): Prevent the contents of the popup from being copied when copying code (#2538)
1 parent 9051c72 commit 80e75a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/plugin-twoslash/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function pluginTwoslash(options?: PluginTwoslashOptions): RspressPlugin {
121121
type: 'element',
122122
tagName: 'twoslash-popup-container',
123123
properties: {
124-
class: 'twoslash-popup-container',
124+
class: 'twoslash-popup-container rp-copy-ignore',
125125
'data-always': 'true',
126126
},
127127
children: [
@@ -148,6 +148,9 @@ export function pluginTwoslash(options?: PluginTwoslashOptions): RspressPlugin {
148148
},
149149
hoverPopup: {
150150
tagName: 'twoslash-popup-container',
151+
properties: {
152+
class: 'twoslash-popup-container rp-copy-ignore',
153+
},
151154
children: elements => [
152155
{
153156
type: 'element',
@@ -172,6 +175,7 @@ export function pluginTwoslash(options?: PluginTwoslashOptions): RspressPlugin {
172175
queryPopup: {
173176
tagName: 'twoslash-popup-container',
174177
properties: {
178+
class: 'twoslash-popup-container rp-copy-ignore',
175179
'data-always': 'true',
176180
},
177181
children: elements => [

0 commit comments

Comments
 (0)