@@ -19,8 +19,6 @@ function CopyMarkdown() {
19
19
const buttonRef = useRef ( null ) ;
20
20
const dropdownRef = useRef ( null ) ;
21
21
22
- console . log ( 'CopyMarkdown component mounted' ) ;
23
-
24
22
// Toggle dropdown
25
23
const toggleDropdown = useCallback ( ( ) => {
26
24
setIsOpen ( prev => ! prev ) ;
@@ -140,30 +138,13 @@ function CopyMarkdown() {
140
138
141
139
// Initialize on client side
142
140
useEffect ( ( ) => {
143
- // More detailed debugging
144
- const h1Elements = document . querySelectorAll ( 'h1' ) ;
145
- console . log ( 'Found h1 elements:' , h1Elements ) ;
146
- h1Elements . forEach ( el => {
147
- console . log ( 'H1 element:' , el ) ;
148
- console . log ( 'H1 text content:' , el . textContent ) ;
149
- console . log ( 'H1 parent element:' , el . parentElement ) ;
150
- console . log ( 'Full element tree:' , el . closest ( 'article' ) ) ;
151
- } ) ;
152
-
153
- // Check for content in multiple ways
141
+ // Check for content
154
142
const hasH1 = document . querySelector ( 'h1' ) ;
155
143
const hasArticle = document . querySelector ( 'article' ) ;
156
144
const hasMainContent = document . querySelector ( 'main' ) ;
157
145
158
- console . log ( 'Detection results:' , {
159
- hasH1 : ! ! hasH1 ,
160
- hasArticle : ! ! hasArticle ,
161
- hasMainContent : ! ! hasMainContent
162
- } ) ;
163
-
164
146
// Set content flag if we have both an h1 and either an article or main element
165
147
const hasMarkdownContent = ! ! hasH1 && ( ! ! hasArticle || ! ! hasMainContent ) ;
166
- console . log ( 'Setting hasContent to:' , hasMarkdownContent ) ;
167
148
setHasContent ( hasMarkdownContent ) ;
168
149
169
150
// Set up click outside handler
0 commit comments