Skip to content

Commit 5558f14

Browse files
committed
fix: rechange condition
1 parent 3d34e1c commit 5558f14

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/common/MarkdownRender.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)