File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -321,14 +321,15 @@ const MarkdownRender: React.FC<MarkdownRenderProps> = ({
321321 }
322322 }
323323
324- // Find the position to insert second ad (only if blockCount >= 35 )
324+ // Find the position to insert second ad (only if blockCount >= 40 )
325325 let secondAdPosition = - 1 ;
326- if ( blockCount >= 35 ) {
327- // 블록이 35 이상인 경우: 25번째부터 40번째까지 h1, h2, h3 찾기
328- secondAdPosition = 24 ; // 25th block (0-based index)
326+ if ( blockCount >= 40 ) {
327+ // 블록이 40 이상인 경우: 35번째부터 50번째(또는 끝)까지 h1, h2, h3 찾기
328+ secondAdPosition = 34 ; // 35th block (0-based index)
329329
330- // Look for first h1, h2, h3 from 25th to 40th block
331- for ( let i = 25 ; i <= 40 && i < blockElements . length ; i ++ ) {
330+ const searchEnd = Math . min ( 50 , blockElements . length ) ;
331+ // Look for first h1, h2, h3 from 35th to searchEnd
332+ for ( let i = 35 ; i < searchEnd ; i ++ ) {
332333 const block = blockElements [ i ] ;
333334 if (
334335 block . tagName === 'H1' ||
@@ -339,7 +340,6 @@ const MarkdownRender: React.FC<MarkdownRenderProps> = ({
339340 break ;
340341 }
341342 }
342- } else {
343343 }
344344
345345 // Insert ads
You can’t perform that action at this time.
0 commit comments